Skip to content

Commit d5747aa

Browse files
committed
Add /bigobj for MSVC builds and remove -s linker switch for macOS. Fixes #25
1 parent 58ff0ea commit d5747aa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ function(setup_executable_target target_name)
6262
-Wall -Wconversion -Wextra -Wextra-semi -Wshadow -Wsign-conversion -Wsuggest-override
6363
-Wunreachable-code -Wno-parentheses -Wno-logical-not-parentheses
6464
$<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:-ffunction-sections -fdata-sections>)
65-
target_link_options(${target_name} PRIVATE
66-
$<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:-s>)
65+
if (UNIX AND NOT APPLE)
66+
target_link_options(${target_name} PRIVATE
67+
$<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:-s>)
68+
endif()
6769
endif()
6870
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
6971
target_compile_options(${target_name} PRIVATE -stdlib=libc++ -Wextra-semi-stmt -Wshadow-all)
@@ -75,7 +77,7 @@ function(setup_executable_target target_name)
7577
endif()
7678
if (MSVC)
7779
target_compile_options(${target_name} PRIVATE
78-
/W4 /permissive /sdl /utf-8 /Za /Zc:__cplusplus /Zc:rvalueCast /Zc:inline
80+
/bigobj /W4 /permissive /sdl /utf-8 /Za /Zc:__cplusplus /Zc:rvalueCast /Zc:inline
7981
/Zc:strictStrings /Zc:throwingNew /Zc:referenceBinding /Zc:wchar_t)
8082
target_link_options(${target_name} PRIVATE
8183
$<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:/OPT:REF /OPT:ICF>)

0 commit comments

Comments
 (0)