Skip to content

Commit 12003cd

Browse files
committed
Fix: Fully transition MSVC optimizations to target_compile_options to fix build error
1 parent 619807e commit 12003cd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1010

1111
if (MSVC)
1212
add_compile_options(/W4 /wd4244 /wd4245 /wd4267 /wd4100 /wd4200)
13-
add_compile_options($<$<CONFIG:Release>:/O2;/Ot;/GL>)
1413
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
15-
add_link_options($<$<CONFIG:Release>:/LTCG>)
1614
else()
1715
add_compile_options(-Wall -Wextra -Wno-sign-compare -Wno-unused-variable -Wno-unused-parameter)
1816
endif()
@@ -220,6 +218,10 @@ if(NOT MSVC)
220218
if(NOT APPLE)
221219
target_link_options(prox_core PUBLIC $<$<CONFIG:Release>:-flto>)
222220
endif()
221+
else()
222+
# Aggressive optimizations for MSVC in Release mode
223+
target_compile_options(prox_core PRIVATE $<$<CONFIG:Release>:/O2 /Ot /GL>)
224+
target_link_options(prox_core PUBLIC $<$<CONFIG:Release>:/LTCG>)
223225
endif()
224226

225227
# Main executable

0 commit comments

Comments
 (0)