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

Michał Górny via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 07:45:24 PST 2017


W dniu 13.02.2017, pon o godzinie 14∶59 +0000, użytkownik NAKAMURA
Takumi via cfe-commits napisał:
> 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)

Are you sure this is the best way of doing it? I'm not a Windows expert
but I've seen others using file(TO_CMAKE_PATH ...) for what I suppose
was the same goal.

> +
>    find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
>      NO_DEFAULT_PATH)
>  
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

-- 
Best regards,
Michał Górny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170213/695776e1/attachment.sig>


More information about the cfe-commits mailing list