Skip to content
Snippets Groups Projects

Updates to toolchain wrappers

Merged Rosen Matev requested to merge rm-wrappers into master
All threads resolved!
2 files
+ 18
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -44,13 +44,19 @@ _dedup_env_path(PATH)
_dedup_env_path(LD_LIBRARY_PATH)
_dedup_env_path(ROOT_INCLUDE_PATH)
# generate wrapper scripts for the compilers
foreach(_cmd IN ITEMS clang++ clang)
# filter out path components inherited from the original environment
string(REGEX MATCHALL "${LCG_releases_base}[^:]+" _path_cleaned "$ENV{PATH}")
string(JOIN ":" _path_cleaned ${_path_cleaned})
string(REGEX MATCHALL "${LCG_releases_base}[^:]+" _ld_library_path_cleaned "$ENV{LD_LIBRARY_PATH}")
string(JOIN ":" _ld_library_path_cleaned ${_ld_library_path_cleaned})
# generate wrapper scripts for the compilers / binutils replacements
foreach(_cmd IN ITEMS clang++ clang llvm-ar llvm-ranlib)
message(STATUS "Writing ${CMAKE_BINARY_DIR}/toolchain/${_cmd} for ${CMAKE_SOURCE_DIR}")
file(WRITE "${CMAKE_BINARY_DIR}/toolchain/${_cmd}"
"#!/bin/sh
export PATH=$ENV{PATH}
export LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}
export PATH=${_path_cleaned}
export LD_LIBRARY_PATH=${_ld_library_path_cleaned}
exec ${COMPILER_ROOT}/bin/${_cmd} \"\$@\"
")
execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/toolchain/${_cmd})
Loading