]> granicus.if.org Git - clang/commitdiff
Merging r294954 and r295592:
authorHans Wennborg <hans@hanshq.net>
Tue, 21 Feb 2017 19:55:46 +0000 (19:55 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 21 Feb 2017 19:55:46 +0000 (19:55 +0000)
------------------------------------------------------------------------
r294954 | chapuni | 2017-02-13 06:59:53 -0800 (Mon, 13 Feb 2017) | 5 lines

Fix r291495 -- Normalize LLVM_CMAKE_PATH in clang standalone build.

CMake handles paths with slashes. It caused cmake/install failure on msbuild.exe.

Note, Other llvm-config-oriented variables have been normalized since they are stored in the cache attributed with PATH.
------------------------------------------------------------------------

------------------------------------------------------------------------
r295592 | chapuni | 2017-02-18 19:17:31 -0800 (Sat, 18 Feb 2017) | 1 line

clang/CMakeLists.txt: Rework r294954 -- use file(TO_CMAKE_PATH).
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@295760 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index c56707e7fb57b53d461e2ff2b822074c503071ca..ff1ff210b56daf1be3c5480d290bf5173b26c299 100644 (file)
@@ -42,7 +42,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
   list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
   list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
   list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
-  list(GET CONFIG_OUTPUT 6 LLVM_CMAKE_PATH)
+  list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
 
   if(NOT MSVC_IDE)
     set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
@@ -57,6 +57,10 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
   set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
   set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
+  # Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
+  # CMake assumes slashes as PATH.
+  file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
+
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
     NO_DEFAULT_PATH)