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

Compile Error on Windows fixed #131

Closed
wants to merge 1 commit into from
Closed

Conversation

bilaljo
Copy link

@bilaljo bilaljo commented Jul 13, 2024

See Build Fails on Windows because of std::min #130

See Build Fails on Windows because of std::min jkriege2#130
@jkriege2
Copy link
Owner

Hi!

thanks for the PR ... may II ask you to change the location of this flag?
If you put it here, it might interfere with projects that compile this library using FetchContent, as this uses the same CMakeLists.txt.

The better location is the function jkqtplotter_setDefaultLibOptions() in https://github.com/jkriege2/JKQtPlotter/blob/master/cmake/jkqtplotter_macros.cmake

There please use target_compile_definitions(${TARGETNAME} PRIVATE NOMINMAX)

This way, the flag is only set WHILE compiling JKQTPlotter and never exposed to other products

@jkriege2
Copy link
Owner

Hi @bilaljo !

I looked into this further ... and to me the above definition should alread be part of all libraries, have a look at this code-line:

https://github.com/jkriege2/JKQtPlotter/blob/aa4ac4c58a099594e88e3c63110dff69136d54b8/cmake/jkqtplotter_macros.cmake#L38C1-L38C64

The given macro is called for all libraries and even exports the MINMAX in the target (declared as public) ...

Could ou elaborate more on the conditions under which ou found the compile errors?

Best,
JAN

@bilaljo
Copy link
Author

bilaljo commented Jul 24, 2024

Hi Jan,

I am sorry for the delay.

Oh yes, you are right!

I did it actually without CMake, I tried to rebuild with Meson to integrate directly into my project, that explains then why it didn't work for me (cause the Macro was defined in CMake only).

@jkriege2
Copy link
Owner

OK, then this can be closed?

@bilaljo
Copy link
Author

bilaljo commented Jul 25, 2024

Yes, thanks a lot.

@bilaljo bilaljo closed this Jul 25, 2024
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