diff options
Diffstat (limited to 'CC/RULES')
-rw-r--r-- | CC/RULES | 118 |
1 files changed, 113 insertions, 5 deletions
@@ -82,6 +82,8 @@ , "compile-args-deps": "compile-args-deps" , "link-deps": "link-deps" , "link-args-deps": "link-args-deps" + , "run-libs-deps": "run-libs-deps" + , "run-libs-args-deps": "run-libs-args-deps" , "cflags-files-deps": "cflags-files-deps" , "ldflags-files-deps": "ldflags-files-deps" , "for host": ["transitions", "for host"] @@ -287,6 +289,10 @@ ] , ["link-deps", {"type": "CALL_EXPRESSION", "name": "link-deps"}] , ["link-args", {"type": "CALL_EXPRESSION", "name": "link-args-deps"}] + , ["run-libs", {"type": "CALL_EXPRESSION", "name": "run-libs-deps"}] + , [ "run-libs-args" + , {"type": "CALL_EXPRESSION", "name": "run-libs-args-deps"} + ] , [ "cflags-files" , {"type": "CALL_EXPRESSION", "name": "cflags-files-deps"} ] @@ -314,6 +320,8 @@ , "compile-args" , "link-deps" , "link-args" + , "run-libs" + , "run-libs-args" , "package" ] } @@ -323,7 +331,14 @@ , "library": { "doc": ["A C++ library"] , "target_fields": - ["srcs", "hdrs", "private-hdrs", "deps", "private-deps", "proto"] + [ "srcs" + , "hdrs" + , "private-hdrs" + , "deps" + , "private-deps" + , "proto" + , "private-proto" + ] , "string_fields": [ "name" , "stage" @@ -332,18 +347,24 @@ , "private-defines" , "cflags" , "private-cflags" + , "ldflags" , "private-ldflags" + , "soversion" , "pkg-name" ] + , "config_fields": ["shared"] , "config_vars": [ "CC" , "CXX" , "CFLAGS" , "CXXFLAGS" + , "LDFLAGS" , "ADD_CFLAGS" , "ADD_CXXFLAGS" + , "ADD_LDFLAGS" , "AR" , "ENV" + , "BUILD_POSITION_INDEPENDENT" ] , "implicit": {"defaults": ["defaults"]} , "field_doc": @@ -377,6 +398,11 @@ ["List of compile flags set for this target and its consumers."] , "private-cflags": ["List of compile flags set for source files local to this target."] + , "ldflags": + [ "Additional linker flags for linking external libraries for this" + , "target and its consumers (not built by this tool, typically system" + , "libraries)." + ] , "private-ldflags": [ "Additional linker flags for linking external libraries (not built" , "by this tool, typically system libraries)." @@ -393,6 +419,18 @@ , "duplicate work will be carried out, even if the same proto library" , "is used at various places)." ] + , "private-proto": + [ "Any [\"proto\", \"library\"] this target depends upon privately." + , "The creation of C++ bindings for this proto library as well as of" + , "its dependencies will be taken care of (as anonymous targets, so no" + , "duplicate work will be carried out, even if the same proto library" + , "is used at various places)." + ] + , "shared": ["If non-empty, produce a shared instead of a static library."] + , "soversion": + [ "The SOVERSION for shared libraries. Individual version components are" + , "joined with \".\"." + ] , "pkg-name": [ "Name to use for pkg-config files. If this field is empty, the field" , "\"name\" is used instead." @@ -420,6 +458,12 @@ , "adapting the default target [\"CC\", \"defaults\"] is the better" , "choice." ] + , "LDFLAGS": + [ "The linker flags to be used instead of the default ones." + , "For libraries that should be built in a non-standard way; usually" + , "adapting the default target [\"CC\", \"defaults\"] is the better" + , "choice." + ] , "ADD_CFLAGS": [ "The flags to add to the default ones for CC." , "For libraries that should be built in a non-standard way; usually" @@ -432,11 +476,18 @@ , "adapting the default target [\"CC\", \"defaults\"] is the better" , "choice." ] + , "ADD_LDFLAGS": + [ "The linker flags to add to the default ones." + , "For libraries that should be built in a non-standard way; usually" + , "adapting the default target [\"CC\", \"defaults\"] is the better" + , "choice." + ] , "AR": [ "The archive tool to used for creating the library" , "If None, the respective value from [\"CC\", \"defaults\"] will be taken." ] , "ENV": ["The environment for any action generated."] + , "BUILD_POSITION_INDEPENDENT": ["Build with -fPIC."] } , "artifacts_doc": ["The actual library (libname.a) staged in the specified directory"] @@ -464,9 +515,29 @@ , "service library": ["./", "proto", "service library"] } } + , "private-proto-deps": + { "target": "private-proto" + , "provider": "proto" + , "rule_map": + { "library": ["./", "proto", "library"] + , "service library": ["./", "proto", "service library"] + } + } } , "imports": - {"artifacts": ["./", "..", "field_artifacts"], "result": "lib result"} + { "artifacts": ["./", "..", "field_artifacts"] + , "static result": "lib result" + , "shared result": "shared result" + , "fPIC transition": ["transitions", "with fPIC"] + } + , "config_transitions": + { "deps": [{"type": "CALL_EXPRESSION", "name": "fPIC transition"}] + , "private-deps": [{"type": "CALL_EXPRESSION", "name": "fPIC transition"}] + , "proto-deps": [{"type": "CALL_EXPRESSION", "name": "fPIC transition"}] + , "private-proto-deps": + [{"type": "CALL_EXPRESSION", "name": "fPIC transition"}] + , "defaults": [{"type": "CALL_EXPRESSION", "name": "fPIC transition"}] + } , "expression": { "type": "let*" , "bindings": @@ -534,7 +605,9 @@ } } ] + , ["ldflags", {"type": "FIELD", "name": "ldflags"}] , ["private-ldflags", {"type": "FIELD", "name": "private-ldflags"}] + , ["soversion", {"type": "FIELD", "name": "soversion"}] , [ "pkg-name" , { "type": "if" , "cond": {"type": "FIELD", "name": "pkg-name"} @@ -543,12 +616,28 @@ , "else": {"type": "var", "name": "name"} } ] + , [ "defaults-transition" + , {"type": "CALL_EXPRESSION", "name": "fPIC transition"} + ] + , [ "deps-transition" + , {"type": "CALL_EXPRESSION", "name": "fPIC transition"} + ] , ["public-fieldnames", ["deps", "proto-deps", "defaults"]] , [ "private-fieldnames" - , ["deps", "private-deps", "proto-deps", "defaults"] + , [ "deps" + , "private-deps" + , "proto-deps" + , "private-proto-deps" + , "defaults" + ] ] ] - , "body": {"type": "CALL_EXPRESSION", "name": "result"} + , "body": + { "type": "if" + , "cond": {"type": "FIELD", "name": "shared"} + , "then": {"type": "CALL_EXPRESSION", "name": "shared result"} + , "else": {"type": "CALL_EXPRESSION", "name": "static result"} + } } } , "binary": @@ -563,7 +652,17 @@ , "private-ldflags" ] , "config_vars": - ["CC", "CXX", "CFLAGS", "CXXFLAGS", "ADD_CFLAGS", "ADD_CXXFLAGS", "ENV"] + [ "CC" + , "CXX" + , "CFLAGS" + , "CXXFLAGS" + , "LDFLAGS" + , "ADD_CFLAGS" + , "ADD_CXXFLAGS" + , "ADD_LDFLAGS" + , "ENV" + , "BUILD_POSITION_INDEPENDENT" + ] , "implicit": {"defaults": ["defaults"]} , "field_doc": { "name": ["The name of the binary"] @@ -611,6 +710,10 @@ [ "The flags for CXX to be used instead of the default ones" , "taken from the [\"CC\", \"defaults\"] target" ] + , "LDFLAGS": + [ "The linker flags do be used instead of the default ones" + , "taken from the [\"CC\", \"defaults\"] target" + ] , "ADD_CFLAGS": [ "The flags to add to the default ones for CC" , "taken from the [\"CC\", \"defaults\"] target" @@ -619,7 +722,12 @@ [ "The flags to add to the default ones for CXX" , "taken from the [\"CC\", \"defaults\"] target" ] + , "ADD_LDFLAGS": + [ "The linker flags to add to the default ones" + , "taken from the [\"CC\", \"defaults\"] target" + ] , "ENV": ["The environment for any action generated."] + , "BUILD_POSITION_INDEPENDENT": ["Build with -fPIC."] } , "artifacts_doc": ["The final binary, staged to the given directory"] , "runfiles_doc": ["None"] |