Store configure task parameters in configuration cache data - close #151

This commit is contained in:
josh committed 2022-02-14 21:52:35 -05:00
1 parent 7e5c6e6b12
commit 5b6353395d
10 files changed
+102 -8

No files matched your search

+17
View File
@@ -24,6 +24,7 @@ build steps, but also provides an extensible framework for performing
custom build operations as well.
Rscons takes inspiration from:
* [SCons](https://scons.org/)
* [waf](https://waf.io/)
* [rake](https://github.com/ruby/rake)
@@ -293,6 +294,22 @@ task "two" do
end
```
Task parameters can also be referenced via construction variables.
Each task parameter is stored in a construction variable.
The name for the construction variable is created by joining the task name
and the parameter name with a ":" character.
For example:
```ruby
task "build", params: [
param("heap-size", "1024", true, "Set heap size"),
] do
env["CPPDEFINES"] << "HEAP_SIZE=${build:heap-size}"
env.Program("^/myprog", glob("src/**/*.c"))
env.Install("${configure:prefix}/bin/myprog", "^/myprog")
end
```
###> Tasks with Special Meaning
Rscons recognizes special meaning for a few tasks: