[PATCH] D28908: [Compiler-rt] Broken compiler-rt CMake configuring on Windows

Oleg Ranevskyy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 09:32:36 PST 2017


iid_iunknown created this revision.
Herald added a subscriber: dberris.

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`.


Repository:
  rL LLVM

https://reviews.llvm.org/D28908

Files:
  cmake/Modules/CompilerRTUtils.cmake


Index: cmake/Modules/CompilerRTUtils.cmake
===================================================================
--- cmake/Modules/CompilerRTUtils.cmake
+++ cmake/Modules/CompilerRTUtils.cmake
@@ -225,7 +225,8 @@
     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")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28908.84982.patch
Type: text/x-patch
Size: 687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170119/534b35cb/attachment.bin>


More information about the llvm-commits mailing list