-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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: Use NOMINMAX on Windows #11385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's still two more instances of specific NOMINMAX
use:
target_compile_definitions(updater PRIVATE NOMINMAX "PSAPI_VERSION=2") |
target_compile_definitions(decklink PRIVATE $<$<PLATFORM_ID:Windows>:NOMINMAX>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth noting this only applies to C++ code (thanks MS) and we'll still have to deal with min()
/max()
macros in C code, but this will at least solve ambiguities and the related issues with the Qualcomm PR.
815416a
to
6474063
Compare
Removed those. Thanks. The commits may need squashed to avoid the first two commits failing. |
This prevents the Windows headers from defining min/max macros. Use std::min and std::max. Modifies deps, frontend, libobs-d3d11, libobs-winrt, decklink, obs-vst, and win-dshow.
6474063
to
6ee84c7
Compare
Description
This PR makes a few changes.
NOMINMAX
as a default compile definition on Windows to prevent defining min/max macrosMotivation and Context
Want to just use STL std::min/std::max and avoid shenanigans with min/max macros.
See also:
Also needs:
Can remove the
/wd4005
additions later when other changes land in the Elgato submodule to properly guard NOMINMAX.How Has This Been Tested?
Built locally on Windows 11. Still needs built with VS for/on WoA to make sure it works.
Types of changes
Checklist: