Osman Zakir via llvm-dev
2019-Oct-28 11:08 UTC
[llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions?
Hi. I'm trying to build LLVM 10.0.0 with CMake on the command line (Developer Command Prompt for VS2019) and I need to know how to switch to a static runtime. I've tried setting LLVM's variable for this, but it didn't work. I still have a dynamic runtime. Along with that, I also need to know how to enable C++ exceptions. One thing I tried was to do "-DCMAKE_CXX_FLAGS="/std:c++17 /MT /EHsc /permissive-"" but this also didn't work. Specifying these on the CXXFLAGS environment variable didn't do anything either. I was using the same session of the Developer Command Prompt, but I made sure to run "refreshenv" to take the new environment from the registry before continuing. I did try to do "-DLLVM_ENABLE_EH=On" but I still got a warning from CMake (from benchmarks/CMakeLists.txt, if I recall correctly) saying that using std::regex with exceptions disabled isn't fully supported. Any help is appreciated. Thanks in advance (I also sent an email on the CMake mailing list, by the way). -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191028/1b3d5426/attachment.html>
Osman Zakir via llvm-dev
2019-Oct-28 11:47 UTC
[llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions?
I ran this command "cmake -S../llvm -G"Visual Studio 16 2019" -Thost=x64 -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MT -DCMAKE_CXX_FLAGS="/permissive- /EHsc /std:c++17 /O2 /MT /D_SILENCE_ALL_CXX_DEPRECATION_WARNINGS" -DLLVM_ENABLE_RTTI=On -DLLVM_ENABLE_EH=ON -DCMAKE_CXX_STANDARD=17 -DPYTHON_HOME=C:/Users/Osman/AppData/Local/Programs/Python/Python38 -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;libcxx;libcxxabi"". But I still get "Using Release VC++ CRT: MD", and also the CMake warning: "CMake Warning at utils/benchmark/CMakeLists.txt:244 (message): Using std::regex with exceptions disabled is not fully supported". Please help. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191028/186e386d/attachment.html>
Alexandre Ganea via llvm-dev
2019-Oct-28 12:10 UTC
[llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions?
Hi Osman, You can’t enable the static CRT through the command-line. You would need to apply this patch: https://reviews.llvm.org/D55056 (although it doesn’t work with lldb) Alex. ________________________________ De : llvm-dev <llvm-dev-bounces at lists.llvm.org> de la part de Osman Zakir via llvm-dev <llvm-dev at lists.llvm.org> Envoyé : 28 octobre 2019 07:47:43 À : llvm-dev at lists.llvm.org <llvm-dev at lists.llvm.org> Objet : Re: [llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions? I ran this command "cmake -S../llvm -G"Visual Studio 16 2019" -Thost=x64 -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MT -DCMAKE_CXX_FLAGS="/permissive- /EHsc /std:c++17 /O2 /MT /D_SILENCE_ALL_CXX_DEPRECATION_WARNINGS" -DLLVM_ENABLE_RTTI=On -DLLVM_ENABLE_EH=ON -DCMAKE_CXX_STANDARD=17 -DPYTHON_HOME=C:/Users/Osman/AppData/Local/Programs/Python/Python38 -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;libcxx;libcxxabi"". But I still get "Using Release VC++ CRT: MD", and also the CMake warning: "CMake Warning at utils/benchmark/CMakeLists.txt:244 (message): Using std::regex with exceptions disabled is not fully supported". Please help. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191028/a8032fb5/attachment-0001.html>