"build-dir" option now available for project.json, added to project. #2323

This commit is contained in:
Christoffer Lerno
2025-10-09 23:41:58 +02:00
parent a000ae560a
commit f3b7df2ab0
4 changed files with 7 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
- Error when using $vaarg/$vacount/$vasplat and similar in a macro without vaargs #2510.
- Add splat defaults for designated initialization #2441.
- Add new builtins `$$str_snakecase` `$$str_replace` and `$$str_pascalcase`.
- `"build-dir"` option now available for `project.json`, added to project. #2323
### Fixes
- Bug in `io::write_using_write_byte`.

View File

@@ -9,6 +9,7 @@
const char *project_default_keys[][2] = {
{"authors", "Authors, optionally with email."},
{"benchfn", "Override the benchmark function."},
{"build-dir", "Build location, where intermediate files are placed by default, relative to project file."},
{"c-include-dirs", "Set the include directories for C sources."},
{"c-sources", "Set the C sources to be compiled."},
{"cc", "Set C compiler (defaults to 'cc')."},
@@ -77,6 +78,7 @@ const int project_default_keys_count = ELEMENTLEN(project_default_keys);
const char* project_deprecated_target_keys[] = { "xxxxxxxxxx" };
const char* project_target_keys[][2] = {
{"benchfn", "Override the benchmark function."},
{"build-dir", "Build location, where intermediate files are placed by default, relative to project file."},
{"c-include-dirs", "C sources include directories for the target."},
{"c-include-dirs-override", "Additional C sources include directories for the target, overriding global settings."},
{"c-sources", "Additional C sources to be compiled for the target."},
@@ -182,6 +184,7 @@ static void load_into_build_target(BuildParseContext context, JSONObject *json,
target->run_dir = get_string(context, json, "run-dir", target->run_dir);
// The output directory
target->output_dir = get_string(context, json, "output", target->output_dir);
target->build_dir = get_string(context, json, "build-dir", target->build_dir);
if (context.target)
{

View File

@@ -27,6 +27,8 @@ const char* JSON_EXE =
" // \"c-sources\": [ \"csource/**\" ],\n"
" // Include directories for C sources relative to the project file.\n"
" // \"c-include-dirs\": [ \"csource/include\" ],\n"
" // Build location, relative to project file.\n"
" \"build-dir\": \"build\",\n"
" // Output location, relative to project file.\n"
" \"output\": \"build\",\n"
" // Architecture and OS target.\n"

View File

@@ -540,6 +540,7 @@ void view_project(BuildOptions *build_options)
VIEW_STRING_ARRAY("Source paths", "sources", ", ");
VIEW_STRING_ARRAY("C source paths", "c-sources", ", ");
VIEW_STRING("Output location", "output");
VIEW_STRING("Build location", "build-dir");
VIEW_STRING("Output extension", "extension");
VIEW_SETTING("Default optimization level", "opt", optimization_levels);