mirror of https://github.com/AxioDL/metaforce.git
MSVC static library split hack
This commit is contained in:
parent
825acbaa0d
commit
5600bf5172
|
@ -48,7 +48,7 @@ if(APPLE)
|
||||||
list(APPEND PLAT_SRCS startButton.cpp CGameOptionsTouchBarMac.mm)
|
list(APPEND PLAT_SRCS startButton.cpp CGameOptionsTouchBarMac.mm)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(RuntimeCommon
|
set(RUNTIME_SOURCES_A
|
||||||
RetroTypes.hpp RetroTypes.cpp
|
RetroTypes.hpp RetroTypes.cpp
|
||||||
${CLIENT_SOURCES}
|
${CLIENT_SOURCES}
|
||||||
${MP1_SOURCES}
|
${MP1_SOURCES}
|
||||||
|
@ -56,7 +56,9 @@ add_library(RuntimeCommon
|
||||||
${AUTOMAPPER_SOURCES}
|
${AUTOMAPPER_SOURCES}
|
||||||
${CAMERA_SOURCES}
|
${CAMERA_SOURCES}
|
||||||
${CHARACTER_SOURCES}
|
${CHARACTER_SOURCES}
|
||||||
${COLLISION_SOURCES}
|
${COLLISION_SOURCES})
|
||||||
|
|
||||||
|
set(RUNTIME_SOURCES_B
|
||||||
${GRAPHICS_SOURCES}
|
${GRAPHICS_SOURCES}
|
||||||
${GUISYS_SOURCES}
|
${GUISYS_SOURCES}
|
||||||
${INPUT_SOURCES}
|
${INPUT_SOURCES}
|
||||||
|
@ -116,15 +118,29 @@ add_library(RuntimeCommon
|
||||||
TCastTo.hpp TCastTo.cpp
|
TCastTo.hpp TCastTo.cpp
|
||||||
GCNTypes.hpp
|
GCNTypes.hpp
|
||||||
${PLAT_SRCS})
|
${PLAT_SRCS})
|
||||||
|
|
||||||
|
function(add_runtime_common_library name)
|
||||||
|
add_library(${name} ${ARGN})
|
||||||
if(COMMAND add_sanitizers)
|
if(COMMAND add_sanitizers)
|
||||||
add_sanitizers(RuntimeCommon)
|
add_sanitizers(${name})
|
||||||
endif()
|
endif()
|
||||||
if(COMMAND cotire)
|
if(COMMAND cotire)
|
||||||
set_target_properties(RuntimeCommon PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
set_target_properties(${name} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
||||||
cotire(RuntimeCommon)
|
cotire(${name})
|
||||||
endif()
|
endif()
|
||||||
add_dependencies(RuntimeCommon ${HECL_APPLICATION_REPS_TARGETS_LIST})
|
add_dependencies(${name} ${HECL_APPLICATION_REPS_TARGETS_LIST})
|
||||||
|
|
||||||
if(WINDOWS_STORE)
|
if(WINDOWS_STORE)
|
||||||
set_property(TARGET RuntimeCommon PROPERTY VS_WINRT_COMPONENT TRUE)
|
set_property(TARGET ${name} PROPERTY VS_WINRT_COMPONENT TRUE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
# WTF MS???? LINK.EXE is unable to address static libraries larger than 4GB.
|
||||||
|
# This is a hack to split this large library in two.
|
||||||
|
add_runtime_common_library(RuntimeCommon ${RUNTIME_SOURCES_A})
|
||||||
|
add_runtime_common_library(RuntimeCommonB ${RUNTIME_SOURCES_B})
|
||||||
|
target_link_libraries(RuntimeCommon RuntimeCommonB)
|
||||||
|
else()
|
||||||
|
add_runtime_common_library(RuntimeCommon ${RUNTIME_SOURCES_A} ${RUNTIME_SOURCES_B})
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue