summaryrefslogtreecommitdiff
path: root/rules/CC/auto
AgeCommit message (Collapse)Author
2024-12-11["CC","auto"]: amend runnerAlberto Sartori
The parsing logic was buggy: - quotation was not properly taken into account - multiple keys provided as "@KEY1@${KEY2}@KEY3@" were not correctly parsed - #cmakedefine KEY1 "@KEY2@" was not correctly parsed: in this case, only @KEY2@ must be expanded, provided variable KEY1 is defined - only lines containing the magic string were processed
2024-12-04config_file: Support PATH from defaultsOliver Reiche
2024-08-30Drop expressions for first/last element of a list entirelyKlaus Aehlig
... as using the built-in "[]" directly is cleaner and equally readable.
2024-07-01["CC/auto", "config"]: honor bin dirs of shell defaultsKlaus Aehlig
2024-05-24Prefer built-in array access over implementing "first" and "last" using foldlKlaus Aehlig
2024-05-21["CC/auto", "config"] also honor shell-toolchain-provided PATHKlaus Aehlig
2024-05-15Add shell defaultsKlaus Aehlig
So far, our rules, where depending on the shell, implicitly use "normal" defaults, hard-coded in the rules. Support configuring those in a default target, in the same way we do so for other tools, like the C compiler. In this, it is also possible to bring your own shell, built as a (compiled) target.
2023-11-09["CC/auto", "config_file"] runner: let /usr/bin/env find python3Klaus T. Aehlig
... instead of assuming it to be installed under /usr/bin as we also do in other places. In this way, we do not make any additional assumptions on top of the already existing one on the path of env.
2023-08-29python: Add type hints and fix style in rules scriptsPaul Cristian Sarbu
2023-08-21rules: Add documentation for the implict dependenciesKlaus Aehlig
2023-08-17["CC/auto", "config_file"] rename implicit targetKlaus Aehlig
... and mention it at the appropriate part of the documentation. While there, also provide a default TARGETS file.
2023-08-16rules: Propagate PATH list from defaultsOliver Reiche
... instead of creating an ENV from it and propagating this. The idea is to keep PATH entries separate and only join them with ":" when we need it. In this way, we can accumulate PATHs from multiple defaults later, and perform a deduplication ("nub_left") to shorten the final string length.
2023-05-30rules: Support for external toolchainsOliver Reiche
2023-05-30rules: Use field_map_provider for default-ENVOliver Reiche
2023-05-05rules: Test symbol and macro separately for auto configOliver Reiche
2023-03-15rules: CC/auto: add "config_file" rule to generate a c/c++ header...Alberto Sartori
...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
2022-12-16rules: Parallelize ["CC/auto", "config"] check actionsOliver Reiche
2022-12-16rules: Use common expressions for ["CC/auto", "config"]Oliver Reiche
2022-12-14rules: Add type size check to ["CC/auto", "config"]Oliver Reiche
2022-12-09rules: Refactoring and minor improvementsOliver Reiche
Compared to the previous commit, the action graphs for just and its unit tests are unchanged. - Git hash of action graph for ["",""]: c6e75f17abd7ffaab6ff9bb725ad67ec0bf6c973 - Git hash of action graph for ["test/buildtool","TESTS"]: 8063dfb3dd7daa9ae01d95c177e14946f785c57e Refactor: - "local cflags" to "private-cflags" - "local defines" to "private-defines" - "link externals" to "private-ldflags" - "deps" to "private-deps" for (test) binaries - "proto" to "private-proto" for binaries Improvements: - consistent variable declaration order: OS, ARCH, HOST_ARCH, TARGET_ARCH, CC, CXX, CFLAGS, CXXFLAGS, ADD_CFLAGS, ADD_CXXFLAGS, AR, ENV, PATH - use fields close to their definition (in RULES) - use common expression for binaries and test binaries - split expression "flags" and "compiler" ... to separate ones for CC and CXX. - rename "transition" to "deps-transition" ... to avoid conflicts with other transitions. - support "defaults-transition" for CC expressions Implement: - "cflags" for libraries - "private-cflags" for (test) binaries - "private-defines" for test binaries - "private-ldflags" for test binaries - (public) "defines" for libraries
2022-10-27rules: Honor ENV for finding catChristian Lütke Stetzkamp
2022-10-10rules: New rule for config header generationOliver Reiche