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 | 5c517c8cf9a28942394a29d95a31a1cde412b26d (patch) | |
tree | 3bffdf568fbb11438cc84b3c601b52171950edad | |
parent | 52467f17b7b99b044267617c33f142f66ef5d0d7 (diff) | |
download | rules-cc-5c517c8cf9a28942394a29d95a31a1cde412b26d.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-- | CC/EXPRESSIONS | 4 | ||||
-rw-r--r-- | CC/RULES | 7 | ||||
-rw-r--r-- | CC/proto/RULES | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS index fdef17f..7871ace 100644 --- a/CC/EXPRESSIONS +++ b/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" @@ -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/CC/proto/RULES b/CC/proto/RULES index a4579e7..d53ab35 100644 --- a/CC/proto/RULES +++ b/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" |