diff options
author | Martin Storsjo <martin@martin.st> | 2018-06-20 21:03:34 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-06-20 21:03:34 +0000 |
commit | 7ef8270ddac1d8eb91647b9abd5e1cfc9d5a48ec (patch) | |
tree | 600d1a34f7db2b577ead17763df9b16a111e4ed4 /cmake | |
parent | 5aa278078ee593388123e1dedda6e9da06df5253 (diff) | |
download | external_libcxx-7ef8270ddac1d8eb91647b9abd5e1cfc9d5a48ec.tar.gz external_libcxx-7ef8270ddac1d8eb91647b9abd5e1cfc9d5a48ec.tar.bz2 external_libcxx-7ef8270ddac1d8eb91647b9abd5e1cfc9d5a48ec.zip |
[CMake] Convert paths to the right form in standalone builds on Windows
The paths output from llvm-config --cmakedir and from clang
--print-libgcc-file-name can contain backslashes, while CMake
can't handle the paths in this form.
This matches what compiler-rt already does (since SVN r203789
and r293195).
Differential Revision: https://reviews.llvm.org/D48356
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@335172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/HandleCompilerRT.cmake | 3 | ||||
-rw-r--r-- | cmake/Modules/HandleOutOfTreeLLVM.cmake | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cmake/Modules/HandleCompilerRT.cmake b/cmake/Modules/HandleCompilerRT.cmake index e9da3c43a..2e0e69e5e 100644 --- a/cmake/Modules/HandleCompilerRT.cmake +++ b/cmake/Modules/HandleCompilerRT.cmake @@ -14,6 +14,7 @@ function(find_compiler_rt_library name dest) OUTPUT_VARIABLE LIBRARY_FILE ) string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE) + file(TO_CMAKE_PATH "${LIBRARY_FILE}" LIBRARY_FILE) string(REPLACE "builtins" "${name}" LIBRARY_FILE "${LIBRARY_FILE}") if (NOT HAD_ERROR AND EXISTS "${LIBRARY_FILE}") message(STATUS "Found compiler-rt library: ${LIBRARY_FILE}") @@ -37,6 +38,7 @@ function(find_compiler_rt_dir dest) OUTPUT_VARIABLE LIBRARY_DIR ) string(STRIP "${LIBRARY_DIR}" LIBRARY_DIR) + file(TO_CMAKE_PATH "${LIBRARY_DIR}" LIBRARY_DIR) set(LIBRARY_DIR "${LIBRARY_DIR}/darwin") else() set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXX_COMPILE_FLAGS} @@ -47,6 +49,7 @@ function(find_compiler_rt_dir dest) OUTPUT_VARIABLE LIBRARY_FILE ) string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE) + file(TO_CMAKE_PATH "${LIBRARY_FILE}" LIBRARY_FILE) get_filename_component(LIBRARY_DIR "${LIBRARY_FILE}" DIRECTORY) endif() if (NOT HAD_ERROR AND EXISTS "${LIBRARY_DIR}") diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake index 83948b14f..70eed1d70 100644 --- a/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -46,10 +46,11 @@ macro(find_llvm_parts) OUTPUT_VARIABLE CONFIG_OUTPUT ERROR_QUIET) if(NOT HAD_ERROR) - string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH) + string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH_FROM_LLVM_CONFIG) + file(TO_CMAKE_PATH "${LLVM_CMAKE_PATH_FROM_LLVM_CONFIG}" LLVM_CMAKE_PATH) else() - set(LLVM_CMAKE_PATH - "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + file(TO_CMAKE_PATH "${LLVM_BINARY_DIR}" LLVM_BINARY_DIR_CMAKE_STYLE) + set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") endif() else() set(LLVM_FOUND OFF) |