Use bigobj for all targets.

GitOrigin-RevId: ba568d92a0e7291db222b3a52a704eb1f4cdc8f0
This commit is contained in:
levlam 2020-10-29 13:39:00 +03:00
parent 357ed48e0e
commit 98d853227a

View File

@ -156,7 +156,7 @@ if (MSVC)
string(REPLACE "/RTC1" " " CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
endif()
add_definitions(-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8 /GR- /W4 /wd4100 /wd4127 /wd4324 /wd4505 /wd4814 /wd4702")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8 /GR- /W4 /wd4100 /wd4127 /wd4324 /wd4505 /wd4814 /wd4702 /bigobj")
elseif (CLANG OR GCC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STD14_FLAG} -fno-omit-frame-pointer -fno-exceptions -fno-rtti")
if (APPLE)
@ -167,6 +167,12 @@ elseif (CLANG OR GCC)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL")
endif()
if (WIN32 OR CYGWIN)
if (GCC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
endif()
endif()
if (MEMPROF)
check_cxx_compiler_flag(-no-pie CXX_NO_PIE_FLAG)
if (CXX_NO_PIE_FLAG)
@ -888,26 +894,6 @@ target_include_directories(tdjson_static PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
set(BIGOBJ)
if (WIN32 OR CYGWIN)
if (MSVC)
set(BIGOBJ "/bigobj")
elseif (GCC)
set(BIGOBJ "-Wa,-mbig-obj")
endif()
endif()
if (BIGOBJ)
target_compile_options(tdapi PUBLIC ${BIGOBJ})
target_compile_options(tdc PUBLIC ${BIGOBJ})
target_compile_options(tdcore PUBLIC ${BIGOBJ})
target_compile_options(tdclient PUBLIC ${BIGOBJ})
target_compile_options(tdjson PUBLIC ${BIGOBJ})
target_compile_options(tdjson_static PUBLIC ${BIGOBJ})
if (TD_ENABLE_DOTNET)
target_compile_options(tddotnet PUBLIC "/bigobj")
endif()
endif()
if (EMSCRIPTEN)
set(TD_EMSCRIPTEN_SRC td/telegram/td_emscripten.cpp)
add_executable(${TD_EMSCRIPTEN} ${TD_EMSCRIPTEN_SRC})