summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-29 15:30:00 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-29 17:06:06 +0200
commit6e7bd146de617b4b8c87cb2586ff99f45c033f51 (patch)
tree7c65bdbe6464eb1917902939f17cd9005abd63ab /rules
parent6f5f251d6e67c575e54a1cb6fc6ae9a4d94fab0d (diff)
downloadjustbuild-6e7bd146de617b4b8c87cb2586ff99f45c033f51.tar.gz
["CC", "defaults"] rule: Add "ADD_COMPILE_FLAGS"
The C++ programming language is tightly related to the C programming language. Consequently, the command line interface for C and C++ are also related and share quite a number of compile flags. Honor this tight connection by have in our defaults a field allowing to extend both compile flags, those for C as well as those for C++. In this way, build defaults can be described in a more readable way.
Diffstat (limited to 'rules')
-rw-r--r--rules/CC/RULES11
1 files changed, 9 insertions, 2 deletions
diff --git a/rules/CC/RULES b/rules/CC/RULES
index 0c5021c2..a5202cf3 100644
--- a/rules/CC/RULES
+++ b/rules/CC/RULES
@@ -13,6 +13,7 @@
, "CFLAGS"
, "CXXFLAGS"
, "LDFLAGS"
+ , "ADD_COMPILE_FLAGS"
, "ADD_CFLAGS"
, "ADD_CXXFLAGS"
, "ADD_LDFLAGS"
@@ -55,12 +56,16 @@
[ "Linker flags for linking the final CC library. Specifying this field"
, "overwrites values from \"base\"."
]
+ , "ADD_COMPILE_FLAGS":
+ [ "Additional compilation flags for C and C++. Specifying this field"
+ , "extends values from \"base\" for both, \"CFLAGS\" and \"CXXFLAGS\"."
+ ]
, "ADD_CFLAGS":
- [ "Additional compilation flags for C. Specifying this field"
+ [ "Additional compilation flags specific for C. Specifying this field"
, "extends values from \"base\"."
]
, "ADD_CXXFLAGS":
- [ "Additional compilation flags for C++. Specifying this field"
+ [ "Additional compilation flags specific for C++. Specifying this field"
, "extends values from \"base\"."
]
, "ADD_LDFLAGS":
@@ -259,6 +264,7 @@
, { "type": "++"
, "$1":
[ {"type": "var", "name": "CFLAGS"}
+ , {"type": "FIELD", "name": "ADD_COMPILE_FLAGS"}
, {"type": "FIELD", "name": "ADD_CFLAGS"}
]
}
@@ -267,6 +273,7 @@
, { "type": "++"
, "$1":
[ {"type": "var", "name": "CXXFLAGS"}
+ , {"type": "FIELD", "name": "ADD_COMPILE_FLAGS"}
, {"type": "FIELD", "name": "ADD_CXXFLAGS"}
]
}