diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-11-20 16:03:21 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-11-20 16:03:21 +0100 |
commit | 65e841f4cb062c77fc6cb14e7283cb0c7a1f0bb8 (patch) | |
tree | e7d9a912c304c030ad48637a82f2f513a83c1150 /rules/CC/foreign/cmake | |
parent | b4dccdd9e27bb570e1d411f8238e4ed0c89e8e1b (diff) | |
parent | 96f7a9f47ee4dafccced87e44f98afa3f14a3df9 (diff) | |
download | rules-cc-65e841f4cb062c77fc6cb14e7283cb0c7a1f0bb8.tar.gz |
Merge subtree 'rules' into rules-cc
Diffstat (limited to 'rules/CC/foreign/cmake')
-rw-r--r-- | rules/CC/foreign/cmake/EXPRESSIONS | 21 | ||||
-rw-r--r-- | rules/CC/foreign/cmake/RULES | 12 |
2 files changed, 25 insertions, 8 deletions
diff --git a/rules/CC/foreign/cmake/EXPRESSIONS b/rules/CC/foreign/cmake/EXPRESSIONS index a36c706..b4a9147 100644 --- a/rules/CC/foreign/cmake/EXPRESSIONS +++ b/rules/CC/foreign/cmake/EXPRESSIONS @@ -24,6 +24,7 @@ , "BUILD_POSITION_INDEPENDENT" , "defaults-transition" , "expand_exec" + , "resolve_symlinks" ] , "imports": { "artifacts": ["", "field_artifacts"] @@ -267,11 +268,11 @@ , "export TMPDIR=\"$(pwd)/scratch\"" , "export TOOLCHAIN=\"$(pwd)/toolchain\"" , "export LOCALBASE=\"$(pwd)/localbase\"" - , "export CC=$([ -x \"${CC}\" ] && realpath ${CC} || echo ${CC})" - , "export CXX=$([ -x \"${CXX}\" ] && realpath ${CXX} || echo ${CXX})" - , "export AR=$([ -x \"${AR}\" ] && realpath ${AR} || echo ${AR})" - , "export MAKE=$([ -x \"${MAKE}\" ] && realpath ${MAKE} || echo ${MAKE})" - , "export CMAKE=$([ -x \"${CMAKE}\" ] && realpath ${CMAKE} || echo ${CMAKE})" + , "export CC=$([ -x \"${CC}\" ] && echo $(pwd)/${CC} || echo ${CC})" + , "export CXX=$([ -x \"${CXX}\" ] && echo $(pwd)/${CXX} || echo ${CXX})" + , "export AR=$([ -x \"${AR}\" ] && echo $(pwd)/${AR} || echo ${AR})" + , "export MAKE=$([ -x \"${MAKE}\" ] && echo $(pwd)/${MAKE} || echo ${MAKE})" + , "export CMAKE=$([ -x \"${CMAKE}\" ] && echo $(pwd)/${CMAKE} || echo ${CMAKE})" , { "type": "join" , "$1": [ "export PATH=\"$(./expand_exec TOOLCHAIN -- echo " @@ -336,9 +337,13 @@ } } } - , [ "mv install install_with_symlinks" - , "cp -rL install_with_symlinks install" - ] + , { "type": "if" + , "cond": {"type": "var", "name": "resolve_symlinks"} + , "then": + [ "mv install install_with_symlinks" + , "cp -rL install_with_symlinks install >copy.log 2>&1 || (echo 'ERROR: symlink resolve failed with:' && cat copy.log && exit 1)" + ] + } , { "type": "if" , "cond": {"type": "var", "name": "post_cmds"} , "then": diff --git a/rules/CC/foreign/cmake/RULES b/rules/CC/foreign/cmake/RULES index b36bc73..166e2d6 100644 --- a/rules/CC/foreign/cmake/RULES +++ b/rules/CC/foreign/cmake/RULES @@ -18,6 +18,7 @@ , "post_cmds" , "out_files" , "out_dirs" + , "resolve_symlinks" ] , "config_vars": [ "ARCH" @@ -78,6 +79,10 @@ , "accessed via \"$CMAKE_SOURCE_DIR\" and \"$CMAKE_BINARY_DIR\"," , "respectively." ] + , "resolve_symlinks": + [ "Resolve all symlinks in the install directory. This operation is" + , "performed immediately after the install, before \"post_cmds\" are run." + ] , "out_files": [ "Paths to the produced output files. The paths are considered relative" , "to the install directory." @@ -204,6 +209,7 @@ , ["cmake_jobs", {"type": "FIELD", "name": "jobs"}] , ["pre_cmds", {"type": "FIELD", "name": "pre_cmds"}] , ["post_cmds", {"type": "FIELD", "name": "post_cmds"}] + , ["resolve_symlinks", {"type": "FIELD", "name": "resolve_symlinks"}] , ["defaults-transition", {"type": "empty_map"}] , [ "expand_exec" , { "type": "let*" @@ -291,6 +297,7 @@ , "hdr_prefix" , "lib_prefix" , "pc_prefix" + , "resolve_symlinks" ] , "config_vars": [ "ARCH" @@ -358,6 +365,10 @@ , "source and build directory can be accessed via \"$CMAKE_SOURCE_DIR\"" , "and \"$CMAKE_BINARY_DIR\", respectively." ] + , "resolve_symlinks": + [ "Resolve all symlinks in the install directory. This operation is" + , "performed immediately after the install, before \"post_cmds\" are run." + ] , "out_hdrs": [ "Paths to produced public header files. The path is considered" , "relative to the include directory, which be set via \"hdr_prefix\"." @@ -607,6 +618,7 @@ , ["cmake_jobs", {"type": "FIELD", "name": "jobs"}] , ["pre_cmds", {"type": "FIELD", "name": "pre_cmds"}] , ["post_cmds", {"type": "FIELD", "name": "post_cmds"}] + , ["resolve_symlinks", {"type": "FIELD", "name": "resolve_symlinks"}] , ["defaults-transition", {"type": "empty_map"}] , [ "expand_exec" , { "type": "let*" |