extension work + static library linking

This commit is contained in:
Hunter 2024-09-28 10:16:00 -04:00
parent ffa0f40652
commit b6ee9d0dc3
20 changed files with 568 additions and 131 deletions

View file

@ -46,6 +46,9 @@ struct LibraryConfig {
/// Type of library
LibraryType lib_type;
/// Package config for the library, leave empty to disable
PackageConfig package_config{};
/// Requirments of the library
Array<Package> requirements;
@ -125,8 +128,8 @@ struct GlobalConfig {
/// Platform to target (pulled from the target config)
PlatformTarget target;
/// Path to the target.hcfg
path target_config;
/// Path to the platform.hcfg, in_memory if not on-disk
string platform_config;
};
```
@ -151,6 +154,9 @@ struct Platform {
/// C compiler
string cc_compiler;
/// Do these compilers produce 32bit code?
bool is_64bit;
/// Type of the platform
PlatformType platform_type;
};
@ -162,4 +168,14 @@ enum LanguageType {
LanguageType_CPP,
LanguageType_C
};
```
## Profile
```c++
struct Profile {
string name;
Array<string> compiler_flags;
Array<string> linker_flags;
};
```

View file

@ -2,7 +2,7 @@
See [datatypes.md](./datatypes.md) for data types/structures
## [X] grbc_get_config() -> GlobalConfig
Get the config
Get the config as as read-write reference
## [X] grbc_want_version(version: String) -> Void
Assure grbc is running on ```version```
@ -28,11 +28,11 @@ Check if we are targeting a 32bit system
## [X] grbc_executable(executable_config: ExecutableConfig) -> TargetInfo
Create a new executable and add it to the build list
## grbc_library(library_config: LibraryConfig) -> TargetInfo
## [X] grbc_library(library_config: LibraryConfig) -> TargetInfo
Create a new library and add it to the build list
## [X] grbc_create_package(package_config: PackageConfig) -> Package
Create a new package
## grbc_pkg(package_name: String) -> Package
Get a package with the given name and return its baked form
## [X] grbc_file(file_path: String) -> Path
Used when listing source files, should perform pre-checks on the file and return its path
@ -68,4 +68,13 @@ Convert the given file path to an object file path
Replace substring in string with replacement
## [X] grbc_include_dirs_to_cflags(include_dirs: Array<String>) -> String
Generate compiler flags to include the given directories
Generate compiler flags to include the given directories
## [X] grbc_compiler_define(define: String, value: String) -> String
Generate a compiler flag to define a variable
## [X] grbc_get_lib_extension(library_type: LibraryType) -> String
Get the given extension for a library file on the current platform
## [X] grbc_bake_package_config(config: PackageConfig) -> Package
Convert a PackageConfig into a Package