summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-12-02 15:33:03 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-12-09 13:13:21 +0100
commit7d260287328a38fbc1430bed56cbdaeaebd58efd (patch)
treec5a94ec2ad2585ce3f592797104af2a9e6e32f80 /src
parent62d155accb047ade3d5a7a89b643e286b333ba41 (diff)
downloadjustbuild-7d260287328a38fbc1430bed56cbdaeaebd58efd.tar.gz
rules: Refactoring and minor improvements
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
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/main/TARGETS6
-rw-r--r--src/buildtool/system/TARGETS2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/buildtool/main/TARGETS b/src/buildtool/main/TARGETS
index 079d3f40..36a8cbff 100644
--- a/src/buildtool/main/TARGETS
+++ b/src/buildtool/main/TARGETS
@@ -3,7 +3,7 @@
, "arguments_config": ["BUILD_STATIC_BINARY"]
, "name": ["just"]
, "srcs": ["main.cpp"]
- , "deps":
+ , "private-deps":
[ ["src/buildtool/common", "cli"]
, ["src/buildtool/common", "config"]
, ["src/buildtool/compatibility", "compatibility"]
@@ -23,7 +23,7 @@
, "describe"
]
, "stage": ["src", "buildtool", "main"]
- , "link external":
+ , "private-ldflags":
{ "type": "if"
, "cond": {"type": "var", "name": "BUILD_STATIC_BINARY"}
, "then": ["-static"]
@@ -101,7 +101,7 @@
, "name": ["version"]
, "hdrs": ["version.hpp"]
, "srcs": ["version.cpp"]
- , "local defines":
+ , "private-defines":
{ "type": "++"
, "$1":
[ { "type": "if"
diff --git a/src/buildtool/system/TARGETS b/src/buildtool/system/TARGETS
index ddc7ae4d..11c2bd47 100644
--- a/src/buildtool/system/TARGETS
+++ b/src/buildtool/system/TARGETS
@@ -4,7 +4,7 @@
, "name": ["system"]
, "hdrs": ["system.hpp"]
, "srcs": ["system.cpp"]
- , "local defines":
+ , "private-defines":
{ "type": "if"
, "cond": {"type": "var", "name": "VALGRIND_BUILD"}
, "then": ["VALGRIND_BUILD"]