Skip to content

Commit 5f7a08d

Browse files
bsyrowikpcolberg
authored andcommitted
Disable conflicting min and max macros on Windows
1 parent 96c64d5 commit 5f7a08d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ include(CTest)
127127
# See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
128128
include(GNUInstallDirs)
129129

130+
# Windows defines its own versions of min() and max() which conflict with the
131+
# versions from the standard library. Disable the Windows versions by defining
132+
# the NOMINMAX macro. This must be set before including acl.h, which
133+
# eventually leads to the inclusion of windows.h, where the min and max macros
134+
# are defined.
135+
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NOMINMAX)
136+
130137
# acl_hostxml includes acl.h, but we don't want to create a cyclic dependency,
131138
# so we create a header only library here
132139
add_library(acl_headers INTERFACE)

0 commit comments

Comments
 (0)