[compiler-rt] r293195 - [Compiler-rt] Broken compiler-rt CMake configuring on Windows

Oleg Ranevskyy via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 10:16:03 PST 2017


Author: oleg
Date: Thu Jan 26 12:16:02 2017
New Revision: 293195

URL: http://llvm.org/viewvc/llvm-project?rev=293195&view=rev
Log:
[Compiler-rt] Broken compiler-rt CMake configuring on Windows

Summary:
Hi Michal,

Would you be able to review this simple fix, please?

Since r291504 compiler-rt uses `llvm-config --cmakedir` to get the path to the LLVM CMake modules.
On Windows this option returns Windows style path with backslashes. CMake treats backslashes as beginning of an escaped character and thus fails to append the path to `CMAKE_MODULE_PATH`.

Reviewers: compnerd, mgorny

Reviewed By: mgorny

Subscribers: compnerd, llvm-commits, dberris

Differential Revision: https://reviews.llvm.org/D28908

Modified:
    compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake?rev=293195&r1=293194&r2=293195&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake Thu Jan 26 12:16:02 2017
@@ -225,7 +225,8 @@ macro(load_llvm_config)
     RESULT_VARIABLE HAD_ERROR
     OUTPUT_VARIABLE CONFIG_OUTPUT)
   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()
     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")




More information about the llvm-commits mailing list