summaryrefslogtreecommitdiff
path: root/CC/EXPRESSIONS
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-03-20 14:58:17 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-04-23 13:05:10 +0200
commit3e0d1255cdf428fb4b7d2381fb82f8db0a0e8bf3 (patch)
treeb0af34fab7614517cabc3b2a87ae789cc24b1907 /CC/EXPRESSIONS
parent5b7031c42ad40d462f1652e4565efcca434a5f61 (diff)
downloadrules-cc-3e0d1255cdf428fb4b7d2381fb82f8db0a0e8bf3.tar.gz
rules CC: Use the -g flag as fallback in debug mode...
...if no flags are otherwise configured (by toolchain or rule-specific configuration variables).
Diffstat (limited to 'CC/EXPRESSIONS')
-rw-r--r--CC/EXPRESSIONS28
1 files changed, 24 insertions, 4 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS
index c52b209..2911c34 100644
--- a/CC/EXPRESSIONS
+++ b/CC/EXPRESSIONS
@@ -819,6 +819,7 @@
, "CXXFLAGS"
, "ADD_CFLAGS"
, "ADD_CXXFLAGS"
+ , "DEBUG"
, "pure C"
, "srcs"
, "hdrs"
@@ -1189,15 +1190,32 @@
, "CXXFLAGS"
, "ADD_CFLAGS"
, "ADD_CXXFLAGS"
+ , "DEBUG"
, "pure C"
, "defaults-transition"
]
, "imports": {"flags-cc": "flags-cc", "flags-cxx": "flags-cxx"}
, "expression":
- { "type": "if"
- , "cond": {"type": "var", "name": "pure C"}
- , "then": {"type": "CALL_EXPRESSION", "name": "flags-cc"}
- , "else": {"type": "CALL_EXPRESSION", "name": "flags-cxx"}
+ { "type": "let*"
+ , "bindings":
+ [ [ "flags"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "pure C"}
+ , "then": {"type": "CALL_EXPRESSION", "name": "flags-cc"}
+ , "else": {"type": "CALL_EXPRESSION", "name": "flags-cxx"}
+ }
+ ]
+ ]
+ , "body":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "flags"}
+ , "then": {"type": "var", "name": "flags"}
+ , "else":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then": ["-g"]
+ }
+ }
}
}
, "lib artifact":
@@ -1210,6 +1228,7 @@
, "ADD_CXXFLAGS"
, "AR"
, "ENV"
+ , "DEBUG"
, "name"
, "pure C"
, "srcs"
@@ -1590,6 +1609,7 @@
, "ADD_CFLAGS"
, "ADD_CXXFLAGS"
, "ENV"
+ , "DEBUG"
, "name"
, "pure C"
, "srcs"