Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init command will now add test-sources to project.json #1520 #1615

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading