diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 3af78dad13..5192d57946 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -146,6 +146,11 @@ add_compile_options( "$<${cxx_exceptions_property}:${cxx_exceptions_on}>" "$<$:${cxx_exceptions_off}>") +if(MSVC) + set(msvc_bigobj_property "$>") + add_compile_options("$<${msvc_bigobj_property}:/bigobj>") +endif() + # We should use -fvisibility=hidden everywhere, as it makes sure we think # about what symbols really should be exposed externally. For more info, see: # https://gcc.gnu.org/wiki/Visibility diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index fa4a218c4f..6b34e75c55 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -100,6 +100,11 @@ target_link_libraries(p3display p3cull p3device p3pgraphnodes PKG::X11) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) +if(HAVE_EIGEN) + # Eigen puts this over the threshold where bigobj is needed on MSVC + set_target_properties(p3display PROPERTIES MSVC_BIGOBJ ON) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3display EXPORT Core COMPONENT Core diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index d6c41ce415..fc88b477d2 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -50,6 +50,11 @@ if(HAVE_AUDIO) endif() target_interrogate(p3grutil ALL) +if(HAVE_EIGEN) + # Eigen puts this over the threshold where bigobj is needed on MSVC + set_target_properties(p3grutil PROPERTIES MSVC_BIGOBJ ON) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3grutil EXPORT Core COMPONENT Core