diff options
-rw-r--r-- | rules/CC/EXPRESSIONS | 28 | ||||
-rw-r--r-- | rules/CC/RULES | 10 |
2 files changed, 32 insertions, 6 deletions
diff --git a/rules/CC/EXPRESSIONS b/rules/CC/EXPRESSIONS index c52b209d..2911c34e 100644 --- a/rules/CC/EXPRESSIONS +++ b/rules/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" diff --git a/rules/CC/RULES b/rules/CC/RULES index eddf0b7a..c6184670 100644 --- a/rules/CC/RULES +++ b/rules/CC/RULES @@ -552,7 +552,10 @@ , "If None, the respective value from [\"CC\", \"defaults\"] will be taken." ] , "ENV": ["The environment for any action generated."] - , "DEBUG": ["Compute the debug-stage, needed for local debugging."] + , "DEBUG": + [ "Compute the debug-stage, needed for local debugging." + , "If no compile flags are otherwise configured, [\"-g\"] will be taken." + ] , "LINT": [ "Also provide nodes describing compile actions and header files;" , "those can be used by lint rules (doing also the config transition)" @@ -752,7 +755,10 @@ , "taken from the [\"CC\", \"defaults\"] target" ] , "ENV": ["The environment for any action generated."] - , "DEBUG": ["Compute the debug-stage, needed for local debugging."] + , "DEBUG": + [ "Compute the debug-stage, needed for local debugging." + , "If no compile flags are otherwise configured, [\"-g\"] will be taken." + ] , "LINT": [ "Also provide nodes describing compile actions and header files;" , "those can be used by lint rules (doing also the config transition)" |