r294954 - Fix r291495 -- Normalize LLVM_CMAKE_PATH in clang standalone build.

NAKAMURA Takumi via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 06:59:53 PST 2017


Author: chapuni
Date: Mon Feb 13 08:59:53 2017
New Revision: 294954

URL: http://llvm.org/viewvc/llvm-project?rev=294954&view=rev
Log:
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.

Modified:
    cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=294954&r1=294953&r2=294954&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Mon Feb 13 08:59:53 2017
@@ -42,7 +42,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   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_CURR
   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.
+  get_filename_component(LLVM_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} ABSOLUTE)
+
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
     NO_DEFAULT_PATH)
 




More information about the cfe-commits mailing list