summaryrefslogtreecommitdiff
path: root/test/buildtool/multithreading/task_system.test.cpp
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2023-02-21 17:01:02 +0100
committerAlberto Sartori <alberto.sartori@huawei.com>2023-03-15 14:36:44 +0100
commit5986dc7eb718c206848ffaad0ab774b1dc1836cb (patch)
tree01bc6fc1cf5b54b2185c70529735e92bbc283f9d /test/buildtool/multithreading/task_system.test.cpp
parent838bdc8729429083f1f6e6efb4c5b80a166569d3 (diff)
downloadjustbuild-5986dc7eb718c206848ffaad0ab774b1dc1836cb.tar.gz
rules: CC/auto: add "config_file" rule to generate a c/c++ header...
...starting from a template (aka configuration file), and using the variables defined via a ["CC/auto", "config"] target. For example, to use a CMake configuration file, the targets could be defined as follows ... , "foo-header-blueprint": { "type": ["@", "rules", "CC/auto", "config_file"] , "input": ["config.hpp.in"] , "output": ["config.hpp"] , "stage": ["foo"] , "magic_string": ["cmakedefine"] , "@only": ["true"] } , "foo-header": { "type": "configure" , "target": "foo-header-blueprint" , "config": { "type": "let*" , "bindings": [ [ "defines" , [ ["var", "\"string value\""] , ["FOO_MAJOR_VERSION", "3"] , ["use_this_feature", true] ] ] ] , "body": {"type": "env", "vars": ["defines"]} } } ... The file config.hpp.in may look as follows #ifndef config_cmake #define config_cmake #cmakedefine var #cmakedefine use_this_feature #cmakedefine01 use_this_feature #cmakedefine unused #define FOO_VERSION @FOO_MAJOR_VERSION@ #define DONT_TOUCH_THIS ${FOO_MAJOR_VERSION} #endif and the generated configuration file foo/config.hpp is #ifndef config_cmake #define config_cmake #define var "string value" #define use_this_feature #define use_this_feature 1 /* #undef unused */ #define FOO_VERSION 3 #define DONT_TOUCH_THIS ${FOO_MAJOR_VERSION} #endif
Diffstat (limited to 'test/buildtool/multithreading/task_system.test.cpp')
0 files changed, 0 insertions, 0 deletions