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

2019-10-28 Thread Juan Sanchez
Hello, It has been a while since I've looked at this stuff, but I do use exceptions in my project. So I add the /EHsc: SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict /EHsc ${WARNINGS_IGNORE}") SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:strict ${WARNINGS_IGNORE}") and I also add a linker

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

2019-10-28 Thread Eric Doenges
By default, CMake will use /EHsc when compiling for the Windows platform, with no option to change this that I am aware of. If a project wants different settings, it needs to handle this itself. And in fact, LLVM 3.4.2 conditionally modifies /EHsc to /EHs-c- in

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

2019-10-28 Thread Mateusz Loskot
On Mon, 28 Oct 2019 at 13:23, Eric Doenges wrote: > I think it is worth adding to what Mateusz wrote that the > MSVC_RUNTIME_LIBRARY property / CMAKE_MSVC_RUNTIME_LIBRARY variable are > only available if policy CMP0091 is set to NEW > Yes, indeed. FWIW, it is also documented in the frame "Note"

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

2019-10-28 Thread Mateusz Loskot
On Mon, 28 Oct 2019 at 13:09, Osman Zakir wrote: > > I did read that. > I tried to specify CMAKE_MSVC_RUNTIME_LIBRARY and MSVC_RUNTIME_LIBRARY as > /MT, -MT and MT, but nothing worked. I'm sorry, but that confirms you did not read that document. Hint 1: "The allowed values are" Hint 2: In

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

2019-10-28 Thread Eric Doenges
I think it is worth adding to what Mateusz wrote that the MSVC_RUNTIME_LIBRARY property / CMAKE_MSVC_RUNTIME_LIBRARY variable are only available if policy CMP0091 is set to NEW, which it will not be because LLVM's CMakeLists.txt only requires CMake 3.4.3 or later (and thus all policies

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

2019-10-28 Thread Osman Zakir
Okay, actually I can't enable a static runtime for LLVM on the command line. I was told about a patch I need to apply. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the

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

2019-10-28 Thread Mateusz Loskot
On Mon, 28 Oct 2019 at 12:22, Osman Zakir wrote: > > And I should do "-DCMAKE_MSVC_RUNTIME_LIBRARY=/MT" Man, read the docs I pasted!!! https://cmake.org/cmake/help/v3.15/prop_tgt/MSVC_RUNTIME_LIBRARY.html Best regards, -- Mateusz Loskot, http://mateusz.loskot.net -- Powered by

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

2019-10-28 Thread Osman Zakir
I tried "-DCMAKE_MSVC_RUNTIME_LIBRARY=MT" and also "-DCMAKE_MSVC_RUNTIME_LIBRARY=/MT" before that, along with "-DCMAKE_BUILD_TYPE=Release", but I still get "Using Release VC++ CRT: MD". What's going on? I also did "-DCMAKE_CXX_FLAGS="/permissive- /EHsc /std:c++17 /O2 /MT

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

2019-10-28 Thread Osman Zakir
Thanks for the reply. What about enabling C++ exceptions? And I should do "-DCMAKE_MSVC_RUNTIME_LIBRARY=/MT" to set the runtime type to static, right? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers

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

2019-10-28 Thread Mateusz Loskot
On Mon, 28 Oct 2019 at 12:01, Osman Zakir wrote: > > 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. This may help (CMake 3.15 or later only):

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

2019-10-28 Thread Osman Zakir
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