diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-11-16 17:04:26 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-11-21 12:43:34 +0100 |
commit | 0c83c812f8cc559c647e6a3c6f3beea71de3bb06 (patch) | |
tree | b6d5027a74bb3fd3097a59994dcf3b959f516870 | |
parent | 30c6536b76eb0ce8f7c8f66ed7b819a36a5ac700 (diff) | |
download | justbuild-0c83c812f8cc559c647e6a3c6f3beea71de3bb06.tar.gz |
support the concept of private deps
i.e., libraries that are used only in the implementation without
use in the public header files. In this way, the set of headers
exposed to dependencies can be reduced leading potentially to better
incrementality.
-rw-r--r-- | rules/CC/EXPRESSIONS | 4 | ||||
-rw-r--r-- | rules/CC/RULES | 7 | ||||
-rw-r--r-- | rules/CC/proto/RULES | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/rules/CC/EXPRESSIONS b/rules/CC/EXPRESSIONS index fdef17f4..7871acef 100644 --- a/rules/CC/EXPRESSIONS +++ b/rules/CC/EXPRESSIONS @@ -486,7 +486,7 @@ , "expression": { "type": "let*" , "bindings": - [ ["deps-fieldnames", ["deps", "proto-deps"]] + [ ["deps-fieldnames", ["deps", "private-deps", "proto-deps"]] , ["compile-deps", {"type": "CALL_EXPRESSION", "name": "compile-deps"}] , ["link-deps", {"type": "CALL_EXPRESSION", "name": "link-deps"}] , ["lib", {"type": "CALL_EXPRESSION", "name": "lib artifact"}] @@ -502,6 +502,8 @@ } } ] + , ["deps-fieldnames", ["deps", "proto-deps"]] + , ["compile-deps", {"type": "CALL_EXPRESSION", "name": "compile-deps"}] ] , "body": { "type": "RESULT" diff --git a/rules/CC/RULES b/rules/CC/RULES index ac81da28..ab01a50f 100644 --- a/rules/CC/RULES +++ b/rules/CC/RULES @@ -170,7 +170,8 @@ } , "library": { "doc": ["A C++ libaray"] - , "target_fields": ["srcs", "hdrs", "private-hdrs", "deps", "proto"] + , "target_fields": + ["srcs", "hdrs", "private-hdrs", "deps", "private-deps", "proto"] , "string_fields": [ "name" , "stage" @@ -220,6 +221,10 @@ , "by this tool, typically system libraries)." ] , "deps": ["Any other libraries this library depends upon."] + , "private-deps": + [ "Any other libraries this library depends upon but does not include" + , "in its public headers." + ] , "proto": [ "Any [\"proto\", \"library\"] this target depends upon directly." , "The creation of C++ bindings for this proto library as well as of" diff --git a/rules/CC/proto/RULES b/rules/CC/proto/RULES index a4579e7e..d53ab35e 100644 --- a/rules/CC/proto/RULES +++ b/rules/CC/proto/RULES @@ -26,6 +26,7 @@ , "proto-deps": [["@", "protoc", "", "C++ runtime"]] , "well_known_protos": [["@", "protoc", "", "well_known_protos"]] , "pure C": [] + , "private-deps": [] } , "imports": { "protoc-compile": "protoc-compile" @@ -72,6 +73,7 @@ ] , "well_known_protos": [["@", "protoc", "", "well_known_protos"]] , "pure C": [] + , "private-deps": [] } , "imports": { "protoc-compile": "protoc-compile" |