Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2021-03-04 18:38:40 +0300
committerRobert Adam <dev@robert-adam.de>2021-03-06 20:57:22 +0300
commitff40c92ab4eec3b5d006809f162480e422d3babc (patch)
tree5c8bbc445f52f2666e2593e4c2885da21e212cc9
parent4e1129b6edbfd2bb6db77d32f5b3ff7a03261869 (diff)
BUILD(cmake): Use big file linker option
Using a unity build tends to create large source files. With that it is easily possible to hit the object file's size limit resulting in the "C1128: number of sections exceeded object file format limit" (MSVC) or "File too big" (GCC) error. In order to avoid this, this commit sets the necessary flag to extend that limit.
-rw-r--r--cmake/compiler.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake
index 4e27ff373..ac4b50d04 100644
--- a/cmake/compiler.cmake
+++ b/cmake/compiler.cmake
@@ -3,6 +3,8 @@
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
+include(CheckCXXCompilerFlag)
+
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(64_BIT TRUE)
elseif(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
@@ -24,6 +26,9 @@ if(MSVC)
"$<$<CONFIG:Release>:/fp:fast>"
)
+ # Needed in order to not run into C1128: number of sections exceeded object file format limit
+ add_compile_options(/bigobj)
+
if(32_BIT)
# SSE2 code is generated by default, unless an explicit arch is set.
# Our 32 bit binaries should not contain any SSE2 code, so override the default.
@@ -61,6 +66,12 @@ elseif(UNIX OR MINGW)
"-Wextra"
)
+ # Avoid "File too big" error
+ check_cxx_compiler_flag("Wa,-mbig-obj" COMPILER_HAS_MBIG_OBJ)
+ if (${COMPILER_HAS_MBIG_OBJ})
+ add_compile_options("-Wa,-mbig-obj")
+ endif()
+
if(options)
add_compile_options(
"-O3"