Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

/MD flag

Scott_S_2
Novice
1,996 Views

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

0 Kudos
5 Replies
AbhishekD_Intel
Moderator
1,996 Views

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

 

0 Kudos
Scott_S_2
Novice
1,996 Views

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

0 Kudos
AbhishekD_Intel
Moderator
1,996 Views

Hi,

Glad to know that your issue is resolved.

Please confirm for us if we can close this thread. You can always open a new thread if you face any issue.

 

Warm Regards,

Abhishek

0 Kudos
Scott_S_2
Novice
1,996 Views

you can close the thread now.

0 Kudos
AbhishekD_Intel
Moderator
1,996 Views

Hi Scott,

Thank you we are closing the thread.

You can also go through cmake-generator-expressions and can specify MSVC_RUNTIME_LIBRARY values using them for more details.

 

Warm Regards,

Abhishek

0 Kudos
Reply