Skip to content

Commit 7f3a1c8

Browse files
authored
Optimize Windows build flags (#52)
* Add `NOMINMAX` and `WIN32_LEAN_AND_MEAN` * Add `/Zc:__cplusplus`
1 parent 35ef3e2 commit 7f3a1c8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ unset(IRIS_CXX_FEATURE_BEFORE_LATEST)
113113
# -----------------------------------------------------------------
114114
# Advanced compile/link settings
115115

116+
if(WIN32)
117+
target_compile_definitions(
118+
_iris_cxx_common
119+
INTERFACE NOMINMAX WIN32_LEAN_AND_MEAN
120+
)
121+
endif()
122+
116123
if(MSVC)
117124
# Don't set too strict flags for testing! They must go to `iris_cxx_test`.
118125
# ABI-dependent configurations MUST be set here.
@@ -123,7 +130,7 @@ if(MSVC)
123130
target_compile_options(
124131
_iris_cxx_common
125132
INTERFACE
126-
/EHsc /MP /utf-8 /Zc:preprocessor /permissive-
133+
/EHsc /MP /utf-8 /Zc:__cplusplus /Zc:preprocessor /permissive-
127134
# $<$<CONFIG:Debug,RelWithDebInfo>:/fsanitize=address> # TODO
128135
)
129136
target_link_options(

0 commit comments

Comments
 (0)