diff options
author | Amir Masoud Abdol <amir.abdol@qt.io> | 2023-05-19 10:11:23 +0200 |
---|---|---|
committer | Amir Masoud Abdol <amir.abdol@qt.io> | 2023-05-31 16:37:22 +0200 |
commit | 585dd9d8d542c85a36cc36bd7420e83b722ad744 (patch) | |
tree | f1e83dfd9e6f7981d9ec67442a2c26054b773849 /cmake/QtInternalTargets.cmake | |
parent | 4e860a66d6e21e93e78d8d3b6b08da09a4870db5 (diff) |
Add NOMINMAX to PlatformCommonInternal
By not explicitly disabling min/max macros of `windows.h`, we may see
some unintended substitutions. This is especially important now that we
are moving toward enabling Unity Build, and some of the constructs for
manually dealing with this issue, eg., `#ifdef max`, `#undef max`, might
not make it to the pool, and as a result we get build failure.
Pick-to: 6.5
Change-Id: Ie3c31aebe00300126a2ac3a6044876ab92d5d99c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtInternalTargets.cmake')
-rw-r--r-- | cmake/QtInternalTargets.cmake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index b5ebc3ef0a..bc515ed56b 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -170,6 +170,8 @@ if(WIN32) # Needed for M_PI define. Same as mkspecs/features/qt_module.prf. # It's set for every module being built, but it's not propagated to user apps. target_compile_definitions(PlatformModuleInternal INTERFACE _USE_MATH_DEFINES) + # Not disabling min/max macros may result in unintended substitutions of std::min/max + target_compile_definitions(PlatformCommonInternal INTERFACE NOMINMAX) endif() if(FEATURE_largefile AND UNIX) target_compile_definitions(PlatformCommonInternal |