summaryrefslogtreecommitdiff
path: root/rules/CC/EXPRESSIONS
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-04-01 11:06:29 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-04-23 15:26:15 +0200
commit75a1d2ce9998afc67ead83147a0081abadadbd54 (patch)
treedd0896919c607a6bacfc8841c78dcb0989f782e0 /rules/CC/EXPRESSIONS
parent7b7ac01aebf9e2c80f02b30d49721ea006b337e7 (diff)
downloadjustbuild-75a1d2ce9998afc67ead83147a0081abadadbd54.tar.gz
expressions CC: Small refactoring
Allow the expressions running the actions producing the library and binary artifacts to pass along more information to consumers if needed by extending their return values to maps. Ensure the changes do not affect other consumers of the current expressions, such as the test rules, which do not expect extra information besides the single action artifact.
Diffstat (limited to 'rules/CC/EXPRESSIONS')
-rw-r--r--rules/CC/EXPRESSIONS86
1 files changed, 82 insertions, 4 deletions
diff --git a/rules/CC/EXPRESSIONS b/rules/CC/EXPRESSIONS
index 03c9c072..476bc117 100644
--- a/rules/CC/EXPRESSIONS
+++ b/rules/CC/EXPRESSIONS
@@ -1500,7 +1500,42 @@
}
}
, "lib artifact":
- { "vars":
+ { "doc": ["Provides the library artifact."]
+ , "vars":
+ [ "CC"
+ , "CXX"
+ , "CFLAGS"
+ , "CXXFLAGS"
+ , "ADD_CFLAGS"
+ , "ADD_CXXFLAGS"
+ , "AR"
+ , "ENV"
+ , "DEBUG"
+ , "name"
+ , "pure C"
+ , "srcs"
+ , "hdrs"
+ , "private-hdrs"
+ , "stage"
+ , "compile-deps"
+ , "compile-args"
+ , "cflags-files"
+ , "defaults-transition"
+ ]
+ , "imports": {"lib action": "lib action"}
+ , "expression":
+ { "type": "lookup"
+ , "key": "library"
+ , "map": {"type": "CALL_EXPRESSION", "name": "lib action"}
+ , "default": {"type": "empty_map"}
+ }
+ }
+, "lib action":
+ { "doc":
+ [ "Run the action producing the library artifact and pass it together with"
+ , "related information to consumers."
+ ]
+ , "vars":
[ "CC"
, "CXX"
, "CFLAGS"
@@ -1715,7 +1750,11 @@
}
]
]
- , "body": {"type": "var", "name": "lib"}
+ , "body":
+ { "type": "singleton_map"
+ , "key": "library"
+ , "value": {"type": "var", "name": "lib"}
+ }
}
}
, "lib result":
@@ -1886,7 +1925,42 @@
}
}
, "bin artifact":
- { "doc": ["Produces the binary artifact."]
+ { "doc": ["Provides the linked binary."]
+ , "vars":
+ [ "CC"
+ , "CXX"
+ , "CFLAGS"
+ , "CXXFLAGS"
+ , "ADD_CFLAGS"
+ , "ADD_CXXFLAGS"
+ , "ENV"
+ , "DEBUG"
+ , "name"
+ , "pure C"
+ , "srcs"
+ , "private-hdrs"
+ , "stage"
+ , "compile-deps"
+ , "compile-args"
+ , "link-deps"
+ , "link-args"
+ , "cflags-files"
+ , "ldflags-files"
+ , "defaults-transition"
+ ]
+ , "imports": {"bin action": "bin action"}
+ , "expression":
+ { "type": "lookup"
+ , "key": "binary"
+ , "map": {"type": "CALL_EXPRESSION", "name": "bin action"}
+ , "default": {"type": "empty_map"}
+ }
+ }
+, "bin action":
+ { "doc":
+ [ "Run the action producing the binary artifact and pass it together with"
+ , "related information to consumers."
+ ]
, "vars":
[ "CC"
, "CXX"
@@ -2106,7 +2180,11 @@
}
]
]
- , "body": {"type": "var", "name": "binary"}
+ , "body":
+ { "type": "singleton_map"
+ , "key": "binary"
+ , "value": {"type": "var", "name": "binary"}
+ }
}
}
, "bin result":