r294954 - Fix r291495 -- Normalize LLVM_CMAKE_PATH in clang standalone build.
NAKAMURA Takumi via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 16 00:17:38 PST 2017
Michał,
It'd make sense to use file(TO_CMAKE_PATH). I forgot it.
I think get_file_component() satisfies in this case. Do you think to use
file(TO_CMAKE_PATH) anyways?
I'll wait for you as an opinion before proposing this fix to release_40.
The bug is still in release_40.
I don't think we could twiddle llvm-config stuff in future. FYI, I explain
its history.
- When autoconf was alive, I tweaked it to let cmake configure against
installed tree generated by autoconf.
- Brad King (@kitware) proposed a mechanism for autoconf to provide cmake
information in llvm.
- Autoconf was killed.
In the ecosystem of cmake, we may go w/o llvm-config but find_package() by
cmake's way.
Then, I suggest to rip out llvm-config here.
Why I introduced cache variables for items supplied by llvm-config;
I thought they are configurable w/o autoconf to specify their variables
manually.
BTW, do you think if llvm-config had an option like "--emit-cmake-tmpl"
to help creating cmake project?
On Tue, Feb 14, 2017 at 12:45 AM Michał Górny <mgorny at gentoo.org> wrote:
> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170216/7feef590/attachment.html>
More information about the cfe-commits
mailing list