diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-07-03 11:56:43 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-07-10 11:26:29 +0200 |
commit | 087dd033bec0bd12e0b2cde0a48163c5093b3dd6 (patch) | |
tree | 9e5f71da789d920934d211d53aff65eb43bda39b | |
parent | fc702619ed6547609a8ac2bf6753858942bb6524 (diff) | |
download | rules-cc-087dd033bec0bd12e0b2cde0a48163c5093b3dd6.tar.gz |
cmake: Make $(AR) available to options
-rw-r--r-- | CC/foreign/cmake/EXPRESSIONS | 26 | ||||
-rw-r--r-- | CC/foreign/cmake/RULES | 8 |
2 files changed, 17 insertions, 17 deletions
diff --git a/CC/foreign/cmake/EXPRESSIONS b/CC/foreign/cmake/EXPRESSIONS index c0b5712..694e0d7 100644 --- a/CC/foreign/cmake/EXPRESSIONS +++ b/CC/foreign/cmake/EXPRESSIONS @@ -112,17 +112,6 @@ } } ] - , [ "ENV" - , { "type": "map_union" - , "$1": - [ {"type": "CALL_EXPRESSION", "name": "default-ENV"} - , {"type": "var", "name": "ENV", "default": {"type": "empty_map"}} - , { "type": "env" - , "vars": ["CC", "CXX", "CXXFLAGS", "CFLAGS", "LDFLAGS"] - } - ] - } - ] , [ "AR" , { "type": "var" , "name": "AR" @@ -146,6 +135,17 @@ } } ] + , [ "ENV" + , { "type": "map_union" + , "$1": + [ {"type": "CALL_EXPRESSION", "name": "default-ENV"} + , {"type": "var", "name": "ENV", "default": {"type": "empty_map"}} + , { "type": "env" + , "vars": ["CC", "CXX", "CXXFLAGS", "CFLAGS", "LDFLAGS", "AR"] + } + ] + } + ] , [ "CMAKE_JOBS" , { "type": "if" , "cond": {"type": "var", "name": "cmake_jobs"} @@ -198,7 +198,7 @@ , [ "readonly CMAKE_SUBDIR=\"$1\"" , "readonly CMAKE_AR=$(which $2)" , "shift 2" - , "${ROOT}/expand_exec TMPDIR LOCALBASE CC CXX CFLAGS CXXFLAGS LDFLAGS -- cmake \"$@\" -S\"source/${CMAKE_SUBDIR}\" -Bbuild -DCMAKE_AR=${CMAKE_AR} -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_PREFIX_PATH=\"$LOCALBASE\" -DPKG_CONFIG_ARGN=--define-prefix --no-warn-unused-cli >configure.log 2>&1 || (cat configure.log && exit 1)" + , "${ROOT}/expand_exec TMPDIR LOCALBASE CC CXX CFLAGS CXXFLAGS LDFLAGS AR -- cmake \"$@\" -S\"source/${CMAKE_SUBDIR}\" -Bbuild -DCMAKE_AR=${CMAKE_AR} -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_PREFIX_PATH=\"$LOCALBASE\" -DPKG_CONFIG_ARGN=--define-prefix --no-warn-unused-cli >configure.log 2>&1 || (cat configure.log && exit 1)" ] , [ { "type": "join" , "separator": " " @@ -206,7 +206,7 @@ { "type": "++" , "$1": [ {"type": "var", "name": "CMAKE_JOBS"} - , [ "${ROOT}/expand_exec TMPDIR LOCALBASE CC CXX CFLAGS CXXFLAGS LDFLAGS -- cmake --build build --target install >build.log 2>&1 || (cat configure.log build.log && exit 1)" + , [ "${ROOT}/expand_exec TMPDIR LOCALBASE CC CXX CFLAGS CXXFLAGS LDFLAGS AR -- cmake --build build --target install >build.log 2>&1 || (cat configure.log build.log && exit 1)" ] ] } diff --git a/CC/foreign/cmake/RULES b/CC/foreign/cmake/RULES index 87805d5..0b1086c 100644 --- a/CC/foreign/cmake/RULES +++ b/CC/foreign/cmake/RULES @@ -3,8 +3,8 @@ [ "Data produced by CMake configure, build, and install." , "" , "All variables accessible to commands and options are: \"TMPDIR\"," - , "\"LOCALBASE\", \"CC\", \"CXX\", \"CFLAGS\", \"CXXFLAGS\", and" - , "\"LDFLAGS\". \"LOCALBASE\" contains the path to the installed artifacts" + , "\"LOCALBASE\", \"CC\", \"CXX\", \"CFLAGS\", \"CXXFLAGS\", \"LDFLAGS\"," + , "and \"AR\". \"LOCALBASE\" contains the path to the installed artifacts" , "from \"deps\"." ] , "target_fields": ["project"] @@ -249,8 +249,8 @@ [ "Library produced by CMake configure, build, and install." , "" , "All variables accessible to commands and options are: \"TMPDIR\"," - , "\"LOCALBASE\", \"CC\", \"CXX\", \"CFLAGS\", \"CXXFLAGS\", and" - , "\"LDFLAGS\". \"LOCALBASE\" contains the path to the installed artifacts" + , "\"LOCALBASE\", \"CC\", \"CXX\", \"CFLAGS\", \"CXXFLAGS\", \"LDFLAGS\"," + , "and \"AR\". \"LOCALBASE\" contains the path to the installed artifacts" , "from \"deps\"." ] , "target_fields": ["project", "deps"] |