Osman Zakir via llvm-dev
2019-Oct-28 14:37 UTC
[llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions?
I would really like to know about how to apply the patch for making MSVC-built LLVM executables lighter. But aside from that, I also want to know what LLVM does to CMake's default setting of /EHsc. I want to keep that setting on, but I can't figure out how. Any help is appreciated. Thanks in advance. P.S. The CMAKE_CXX_FLAGS variable isn't helping at all, otherwise I wouldn't be asking this. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191028/8c4f73ed/attachment.html>
Zachary Turner via llvm-dev
2019-Oct-28 15:18 UTC
[llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions?
Try setting LLVM_ENABLE_EH to ON on the CMake command line. On Mon, Oct 28, 2019 at 7:38 AM Osman Zakir via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I would really like to know about how to apply the patch for making > MSVC-built LLVM executables lighter. But aside from that, I also want to > know what LLVM does to CMake's default setting of /EHsc. I want to keep > that setting on, but I can't figure out how. Any help is appreciated. > Thanks in advance. P.S. The CMAKE_CXX_FLAGS variable isn't helping at all, > otherwise I wouldn't be asking this. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191028/271fc603/attachment.html>
Zachary Turner via llvm-dev
2019-Oct-28 16:43 UTC
[llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions?
It sounds like you probably need to dig into the CMake logic a little bit and find out where the _HAS_EXCEPTIONS=0 define is coming from. Not many people (maybe nobody) uses this configuration, so it's not surprising that it may have some issues. On Mon, Oct 28, 2019 at 9:36 AM Osman Zakir <osmanzakir90 at hotmail.com> wrote:> I already did that. CMake still gives me a warning from > utils/benchmark/CMakeLists.txt saying that using std::regex with exceptions > disabled isn't fully supported. > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191028/842cfbf9/attachment.html>
Osman Zakir via llvm-dev
2019-Oct-28 20:49 UTC
[llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions?
I'll try to do it all from within the IDE. I noticed that the /EHsc flag is already there (makes me wonder why CMake still gave that warning). But I also noticed something else. What's the reason for this in the Post-Build Event command line for INSTALL.vcxproj? " setlocal "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd " Also, libclang.vcxproj has a static runtime set but it was also set to build a DLL instead of a static .lib library. I changed it to have it build a static library. I wonder if that's a good idea. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191028/48bd79a8/attachment.html>