Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: set MSVC_RUNTIME_LIBRARY to MultiThreadedDLL #683

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

ahayzen-kdab
Copy link
Collaborator

Related to #682
Related to #676

@OlivierLDff
Copy link
Contributor

OlivierLDff commented Sep 6, 2023

Will it work for more complex projects? Because then you will have other targets linking to the default, and the app & rust lib to MultiThreadedDLL. Not sure if this is how it work.
I would recommend setting the global CMAKE_MSVC_RUNTIME_LIBRARY so every target do so.

@ahayzen-kdab
Copy link
Collaborator Author

ahayzen-kdab commented Sep 6, 2023

Will it work for more complex projects? Because then you will have other targets linking to the default, and the app & rust lib to MultiThreadedDLL. Not sure if this is how it work. I would recommend setting the global CMAKE_MSVC_RUNTIME_LIBRARY so every target do so.

Can we set this in all of the example CMakeLists.txt's ? I know it's slightly pointless as it should come from the root and is effectively a noop. But we see people copy the CMakeList out of the example folder and then miss that there is something set globally. So i think there should be something in each of the projects too.

I'm also trying to fix my Windows setup so i can test some of this stuff myself 😅

@OlivierLDff
Copy link
Contributor

Yes setting it in each example is a good idea, maybe with a warning that it would be best to set it in the command line.

@ahayzen-kdab ahayzen-kdab force-pushed the 682-cmake-windows-battles branch 2 times, most recently from 60ebf1c to 2fadfde Compare September 6, 2023 12:44
@ahayzen-kdab ahayzen-kdab marked this pull request as ready for review September 6, 2023 13:12
As Rust always uses the non-debug Windows runtime for MSVC targets.

Related to KDAB#682
Related to KDAB#676
@ahayzen-kdab
Copy link
Collaborator Author

This seems to work :-)

@OlivierLDff does the change look sane to you ?

@OlivierLDff
Copy link
Contributor

Yes this is what is required for it to work out of the box.

@ahayzen-kdab ahayzen-kdab merged commit 8f550ca into KDAB:main Sep 8, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants