summaryrefslogtreecommitdiff
path: root/rules/CC/prebuilt/RULES
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-01-20 16:20:30 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2023-01-20 16:20:30 +0100
commit89b76f2558da0c41280b9eb389384824babfbef6 (patch)
tree489057736f3fcc4f9e14bcb27e14eb0effbd815a /rules/CC/prebuilt/RULES
parent25981eeccf645ddc6338bed0b159014f210f4326 (diff)
parente75f101e8b988adb458e594ffaaaebc0c01f65df (diff)
downloadrules-cc-89b76f2558da0c41280b9eb389384824babfbef6.tar.gz
Merge commit 'e75f101e8b988adb458e594ffaaaebc0c01f65df' into rules-cc
Diffstat (limited to 'rules/CC/prebuilt/RULES')
-rw-r--r--rules/CC/prebuilt/RULES31
1 files changed, 29 insertions, 2 deletions
diff --git a/rules/CC/prebuilt/RULES b/rules/CC/prebuilt/RULES
index be2bacc..16f9f26 100644
--- a/rules/CC/prebuilt/RULES
+++ b/rules/CC/prebuilt/RULES
@@ -1,8 +1,13 @@
{ "library":
{ "doc": ["A prebuilt C++ library"]
- , "target_fields": ["lib", "hdrs", "deps"]
+ , "target_fields": ["lib", "hdrs", "deps", "pkg-config"]
, "string_fields":
["name", "version", "stage", "defines", "cflags", "ldflags"]
+ , "implicit":
+ { "defaults": [["./", "..", "defaults"]]
+ , "config_reader": [["CC", "prebuilt/read_pkgconfig.py"]]
+ }
+ , "config_vars": ["ENV"]
, "field_doc":
{ "name":
[ "The name of the library (without leading \"lib\" or trailing file name"
@@ -32,6 +37,13 @@
["List of compile flags set for this target and its consumers."]
, "ldflags":
["Additional linker flags (typically for linking system libraries)."]
+ , "pkg-config":
+ [ "Pkg-config file for optional infer of public cflags and ldflags. If"
+ , "multiple files are specified (e.g., one depends on the other), the"
+ , "first one is used as entry. Note that if this field is non-empty the"
+ , "tool \"pkg-config\" must be available in \"PATH\", which is taken"
+ , "from [\"CC\", \"defaults\"] or the \"ENV\" variable."
+ ]
}
, "artifacts_doc":
[ "The actual library (libname.a or libname.so). Only static libraries are"
@@ -67,7 +79,9 @@
]
}
, "imports":
- { "artifacts_list": ["./", "../..", "field_artifacts_list"]
+ { "artifacts": ["./", "../..", "field_artifacts"]
+ , "artifacts_list": ["./", "../..", "field_artifacts_list"]
+ , "stage_field": ["", "stage_singleton_field"]
, "prebuilt result": "prebuilt result"
}
, "expression":
@@ -112,6 +126,19 @@
, "body": {"type": "CALL_EXPRESSION", "name": "artifacts_list"}
}
]
+ , [ "config_reader"
+ , { "type": "let*"
+ , "bindings":
+ [["fieldname", "config_reader"], ["location", "config_reader"]]
+ , "body": {"type": "CALL_EXPRESSION", "name": "stage_field"}
+ }
+ ]
+ , [ "pkg-configs"
+ , { "type": "let*"
+ , "bindings": [["fieldname", "pkg-config"]]
+ , "body": {"type": "CALL_EXPRESSION", "name": "artifacts_list"}
+ }
+ ]
, ["deps-fieldnames", ["deps"]]
]
, "body": {"type": "CALL_EXPRESSION", "name": "prebuilt result"}