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

zlib 1.3 forces /MD although I build it with /MT on Windows #849

Open
tawmoto opened this issue Aug 24, 2023 · 5 comments
Open

zlib 1.3 forces /MD although I build it with /MT on Windows #849

tawmoto opened this issue Aug 24, 2023 · 5 comments

Comments

@tawmoto
Copy link

tawmoto commented Aug 24, 2023

Hi, I compile my zlib as usual

 cmake -DSKIP_INSTALL_FILES=ON -DCMAKE_C_FLAGS_RELEASE=/MT -DCMAKE_STATIC_LINKER_FLAGS=/SUBSYSTEM:CONSOLE,6.01 -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=RELEASE

Starting with 1.3, the integration with my project fails and seems a MT/MD problem.

When compiling 1.3, I see in the log a lot of warnings about overriding my MT with MD.

image

Tried to diff between my old working 1.2.12 and 1.3 and I could not find yet the problem, thanks.

@nmoinvaz
Copy link
Contributor

I think you must set it using this option https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html.

@tawmoto
Copy link
Author

tawmoto commented Aug 24, 2023

I think you must set it using this option https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html.

Thank you, I will try. I am using my option with all 3rdparties without problem, so it clearly setting the MT correctly, but then it's overridden by MD.
Also it's a mistery why it works with an older version, but with 1.3 it does not work.

@tbeu
Copy link
Contributor

tbeu commented Nov 19, 2023

Can reproduce with CMake 3.27.8. Bisect revealed that 9889e98 is the first bad commit. I created #878 to have MSVC runtime library linkage properly configurable.

@Neustradamus
Copy link

@tawmoto: The @tbeu PR has been merged.
Can you try?
It is solved for you?

@tawmoto
Copy link
Author

tawmoto commented Jan 19, 2024

@tawmoto: The @tbeu PR has been merged. Can you try? It is solved for you?

unfortunately I am unable to test these weeks, I am out of office but I trust that it works.
thank you for the fix

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 a pull request may close this issue.

4 participants