Skip to content

Commit d129cca

Browse files
Add /bigobj compilation flag
Signed-off-by: Kamil Kopryk <[email protected]>
1 parent 6adf069 commit d129cca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,14 @@ else()
578578

579579
endif()
580580

581+
# increase the maximum number of sections in .obj files
582+
if(MSVC)
583+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj")
584+
set(CMAKE_CXX_FLAGS_RELEASEINTERNAL "${CMAKE_CXX_FLAGS_RELEASEINTERNAL} /bigobj")
585+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
586+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
587+
endif()
588+
581589
# setup variables needed for custom configuration type
582590
# generate PDB files even for release build on MSVC
583591
if(MSVC)

0 commit comments

Comments
 (0)