summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-03-03 13:43:44 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-03-03 15:09:11 +0100
commit3e1a403d5790b09dc0b2cdeac22db188d58ff0cc (patch)
tree38b22a53ebe19bedcbd1af60e50dd882e47d4b10
parentd7d7f9d796bc73c8f8cb2dbb6e58039a663f9ef3 (diff)
downloadrules-cc-3e1a403d5790b09dc0b2cdeac22db188d58ff0cc.tar.gz
CC rules: Add support for local cflags
-rw-r--r--CC/EXPRESSIONS9
-rw-r--r--CC/RULES5
2 files changed, 13 insertions, 1 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS
index f1e6592..1002147 100644
--- a/CC/EXPRESSIONS
+++ b/CC/EXPRESSIONS
@@ -322,6 +322,7 @@
, "srcs"
, "hdrs"
, "private-hdrs"
+ , "local cflags"
, "link external"
, "extra-provides"
]
@@ -376,6 +377,14 @@
}
}
]
+ , [ "CXXFLAGS"
+ , { "type": "++"
+ , "$1":
+ [ {"type": "var", "name": "CXXFLAGS"}
+ , {"type": "var", "name": "local cflags", "default": []}
+ ]
+ }
+ ]
, [ "ENV"
, { "type": "map_union"
, "$1":
diff --git a/CC/RULES b/CC/RULES
index 93d5afc..3bbd68c 100644
--- a/CC/RULES
+++ b/CC/RULES
@@ -167,7 +167,7 @@
{ "doc": ["A C++ libaray"]
, "target_fields": ["srcs", "hdrs", "private-hdrs", "deps", "proto"]
, "string_fields":
- ["name", "stage", "pure C", "local defines", "link external"]
+ ["name", "stage", "pure C", "local defines", "local cflags", "link external"]
, "config_vars": ["CXX", "CC", "CXXFLAGS", "CFLAGS", "ENV", "AR"]
, "implicit": {"defaults": ["defaults"]}
, "field_doc":
@@ -192,6 +192,8 @@
[ "List of defines set for source files local to this target."
, "Each list entry will be prepended by \"-D\"."
]
+ , "local cflags":
+ ["List of compile flags set for source files local to this target."]
, "link external":
["Additional linker flags for linking external libraries."]
, "deps": ["Any other libraries this library depends upon."]
@@ -242,6 +244,7 @@
{"type": "join", "$1": ["-D", {"type": "var", "name": "def"}]}
}
]
+ , ["local cflags", {"type": "FIELD", "name": "local cflags"}]
, [ "CFLAGS"
, { "type": "++"
, "$1":