Jonas Hahnfeld via llvm-dev
2018-Jan-26 20:46 UTC
[llvm-dev] CMake warning when compiling Clang/LLVM
Am 2018-01-26 21:36, schrieb Tom Stellard via llvm-dev:> On 01/26/2018 12:32 PM, Simone Atzeni via llvm-dev wrote: >> Hi, >> >> when I run cmake I get the following warning: >> >> --------------------------------------------------------------------------------------- >> CMake Warning at cmake/modules/HandleLLVMStdlib.cmake:24 (message): >> Can't specify libc++ with '-stdlib=' >> Call Stack (most recent call first): >> cmake/config-ix.cmake:15 (include) >> CMakeLists.txt:580 (include) >> --------------------------------------------------------------------------------------- >> >> I am using GCC 4.8.5 to build on a x86_64 machine with RedHat OS. >> >> Any idea why? > > What arguments are you passing to CMake and which version of LLVM are > you > trying to build?That's probably -DLLVM_ENABLE_LIBCXX=ON and the warning tells you the reason: -stdlib= is only supported if compiling with Clang, you can't specify it with GCC. Cheers, Jonas
Simone Atzeni via llvm-dev
2018-Jan-26 20:55 UTC
[llvm-dev] CMake warning when compiling Clang/LLVM
Thanks, that's the reason. So to clarify, I should use -DLLVM_ENABLE_LIBCXX=ON only if I am building clang with clang? I got confused, I thought it was for building libc++, but having that under projects seems to be enough. Thanks. Simone -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180126/dd548d5c/attachment.html>
Jonas Hahnfeld via llvm-dev
2018-Jan-26 21:05 UTC
[llvm-dev] CMake warning when compiling Clang/LLVM
Am 2018-01-26 21:55, schrieb Simone Atzeni:> Thanks, that's the reason. > > So to clarify, I should use -DLLVM_ENABLE_LIBCXX=ON only if I am > building clang with clang? > I got confused, I thought it was for building libc++, but having that > under projects seems to be enough.If libc++ is under projects/ it will get built. What LLVM_ENABLE_LIBCXX does is to enable _linking_ all LLVM libraries and binaries to libc++ as the C++ STL and that's only supported with Clang. You can specify the option when building with GCC, it just won't work and issue the warning you are seeing. Regards, Jonas