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

Use CMAKE_MSVC_RUNTIME_LIBRARY to select BoringSSL C runtime. #1232

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

prbprbprb
Copy link
Collaborator

@prbprbprb prbprbprb commented Sep 16, 2024

Use CMAKE_MSVC_RUNTIME_LIBRARY to select BoringSSL C runtime.

Fixes CI on Windows.

Unsure exactly what triggered it upstream but without this, cmake
starting adding /MD to the cflags and overriding ours, causing
link errors. Switching Conscrypt to /MT causes runtime crashes.

This fix seems better than setting the flags directly anyway.

Maybe worth upstreaming as the default unless there are use cases
for CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL

Fixes CI on Windows.

Unsure exactly what triggered it upstream but without this, cmake
starting adding /MD to the cflags and overriding ours, causing
link errors.  Switching Conscrypt to /MT causes runtime crashes.

This fix seems better than setting the flags directly anyway.

Maybe worth upstreaming as the default unless there are use cases
for CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
@prbprbprb prbprbprb changed the title Switch C runtime library on Windows to match BoringSSL. Use CMAKE_MSVC_RUNTIME_LIBRARY to select BoringSSL C runtime. Sep 16, 2024
@davidben
Copy link
Contributor

Maybe worth upstreaming as the default unless there are use cases for CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL

Hmm, no idea. TBH I'm unclear on what the expectations are for library packages in CMake. I presume you need this to be the same across everything you link? In that case, are libraries supposed to be opinionated or just inherit it from the user?

@prbprbprb
Copy link
Collaborator Author

are libraries supposed to be opinionated or just inherit it from the user

Fair point, probably just inherit from the rest of the project. I didn't dig into why MultiThreadedDLL crashes Conscrypt, so it's not necessarily a problem for other projects.

Thanks for the quick review!

@prbprbprb prbprbprb merged commit a38a7e9 into google:master Sep 16, 2024
14 of 15 checks passed
@prbprbprb prbprbprb deleted the cflags branch September 16, 2024 13:45
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.

2 participants