[CMake] How to Switch to Static Runtime on Command Line?

Osman Zakir osmanzakir90 at hotmail.com
Mon Oct 28 07:01:12 EDT 2019


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 specifying 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.

Note: I don't want to edit the CMakeLists.txt file because I want to be able to run "git pull" without having to stage any changes (I cloned the LLVM GitHub repository for the source code).

Any help is appreciated.  Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20191028/3447e668/attachment.html>


More information about the CMake mailing list