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

Adding support for static Run-Time library (MT/MTd) on MSVC #269

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

rafael-santiago
Copy link
Contributor

Hi there!

I noticed that on MSVC the Run-Time Library switching cannot be done on a command line build task. I was facing a requirement that the static run-time must be used instead the shared. I was obligated did it manually (setting into the .sln) but it was pretty clumsy and cumbersome.

This commit implements the run-time switching through cmake's command line. Now when on Windows and using MSVC if the user desires MT or MTd run-times, she/he should do the following:

cmake -DMSVC_STATIC_RUNTIME=ON -DBUILD_SHARED_LIBS=OFF ..

Once done, the release configuration will use MT and the debug configuration will use MTd.

The default for MSVC_STATIC_RUNTIME is OFF so when ommited the build will take into consideration the shared default (MD / MDd).

Regards!

Copy link
Member

@oschwald oschwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@oschwald oschwald merged commit 1b9284a into maxmind:main Jul 1, 2021
oschwald added a commit that referenced this pull request Jul 1, 2021
@rafael-santiago
Copy link
Contributor Author

You are welcome!

oschwald added a commit that referenced this pull request Jul 6, 2021
horgh added a commit that referenced this pull request Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants