diff --git a/libcxx/cmake/Modules/HandleCompilerRT.cmake b/libcxx/cmake/Modules/HandleCompilerRT.cmake index e9da3c43a211..2e0e69e5e085 100644 --- a/libcxx/cmake/Modules/HandleCompilerRT.cmake +++ b/libcxx/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/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake index 83948b14fd1f..70eed1d70ba1 100644 --- a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/libcxx/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)