Hi,
I'm trying to get a windows build using oneAPI going but the libs I'm trying to include use /MD rather than /MT. Adding the /MD via cmake doesn't show up in the resultant msvc solution. I can add it manually via the additional options box, but this gets wiped every time I regenerate the cmake. Am I missing something?
Thanks
Scott
链接已复制
Hi,
With the Visual Studio Generators, a native build system may choose to add its own default runtime library selection flag. So try to set the same value in the visual studio which you want to use. And you also have to specify the same value in CMake.
If your CMake has a different value you can replace it with what you want, but your visual studio and CMake value should be the same.
Warm Regards,
Abhishek
I was setting the /MD flag in cmake via SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MD) but that doesn't set the correct runtime in the resultant visual studio solution.
Using set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL") does set the visual studio solution correctly.
Cheers
Scott