- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Tags:
- General Support
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can close the thread now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page