Skip to content

Commit

Permalink
Init command will now add test-sources to project.json #1520
Browse files Browse the repository at this point in the history
  • Loading branch information
cardisk authored and lerno committed Nov 12, 2024
1 parent e6b6ede commit 61a76bb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Changes / improvements
- Allow splat in initializers.
- Init command will now add `test-sources` to `project.json` #1520

### Fixes
- Fix bug where `a > 0 ? f() : g()` could cause a compiler crash if both returned `void!`.
Expand Down
3 changes: 3 additions & 0 deletions src/build/project.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const char *project_default_keys[][2] = {
{"single-module", "Compile all modules together, enables more inlining."},
{"soft-float", "Output soft-float functions."},
{"sources", "Paths to project sources for all targets."},
{"test-sources", "Paths to project test sources for all targets."},
{"strip-unused", "Strip unused code and globals from the output. (default: true)"},
{"symtab", "Sets the preferred symtab size."},
{"target", "Compile for a particular architecture + OS target."},
Expand Down Expand Up @@ -116,6 +117,8 @@ const char* project_target_keys[][2] = {
{"soft-float", "Output soft-float functions."},
{"sources", "Additional paths to project sources for the target."},
{"sources-override", "Paths to project sources for this target, overriding global settings."},
{"test-sources", "Additional paths to project test sources for the target."},
{"test-sources-override", "Paths to project test sources for this target, overriding global settings."},
{"strip-unused", "Strip unused code and globals from the output. (default: true)"},
{"symtab", "Sets the preferred symtab size."},
{"target", "Compile for a particular architecture + OS target."},
Expand Down
6 changes: 6 additions & 0 deletions src/build/project_creation.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const char* JSON_EXE =
" \"version\": \"0.1.0\",\n"
" // Sources compiled for all targets.\n"
" \"sources\": [ \"src/**\" ],\n"
" // Test sources compiled for all targets.\n"
" \"test-sources\": [ \"test/**\" ],\n"
" // C sources if the project also compiles C sources\n"
" // relative to the project file.\n"
" // \"c-sources\": [ \"csource/**\" ],\n"
Expand Down Expand Up @@ -63,6 +65,8 @@ const char* JSON_STATIC =
" \"version\": \"0.1.0\",\n"
" // Sources compiled for all targets.\n"
" \"sources\": [ \"src/**\" ],\n"
" // Test sources compiled for all targets.\n"
" \"test-sources\": [ \"test/**\" ],\n"
" // C sources if the project also compiles C sources\n"
" // relative to the project file.\n"
" // \"c-sources\": [ \"csource/**\" ],\n"
Expand Down Expand Up @@ -104,6 +108,8 @@ const char* JSON_DYNAMIC =
" \"version\": \"0.1.0\",\n"
" // Sources compiled for all targets.\n"
" \"sources\": [ \"src/**\" ],\n"
" // Test sources compiled for all targets.\n"
" \"test-sources\": [ \"test/**\" ],\n"
" // C sources if the project also compiles C sources\n"
" // relative to the project file.\n"
" // \"c-sources\": [ \"csource/**\" ],\n"
Expand Down

0 comments on commit 61a76bb

Please sign in to comment.