From 5c517c8cf9a28942394a29d95a31a1cde412b26d Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 16 Nov 2022 17:04:26 +0100 Subject: 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. --- CC/EXPRESSIONS | 4 +++- CC/RULES | 7 ++++++- CC/proto/RULES | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'CC') 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" diff --git a/CC/RULES b/CC/RULES index ac81da2..ab01a50 100644 --- a/CC/RULES +++ b/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/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" -- cgit v1.2.3