CMake: When building on MSVC, add /bigobj to compiler where necessary

This commit is contained in:
Sam Edwards 2019-08-25 15:54:02 -06:00
parent 855d217f35
commit 8588ddc3dc
3 changed files with 15 additions and 0 deletions

View File

@ -146,6 +146,11 @@ add_compile_options(
"$<${cxx_exceptions_property}:${cxx_exceptions_on}>"
"$<$<NOT:${cxx_exceptions_property}>:${cxx_exceptions_off}>")
if(MSVC)
set(msvc_bigobj_property "$<BOOL:$<TARGET_PROPERTY:MSVC_BIGOBJ>>")
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

View File

@ -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

View File

@ -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