Enable /bigobj globally on MSVC.

This changes the intermediate format used for compiled files from one
that can hold up to 65279 (slightly less than 2^16) addressable sections
to one that can hold 4294967296 (2^32).

Code that uses templates, such as... C++ code... can easily run up
against the smaller limit. This does not affect the finished executable,
only the intermediate object files.
develop
Ben Lubar 2020-04-28 18:18:28 -05:00
parent d0c030c3da
commit 1058e40cb0
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
1 changed files with 4 additions and 0 deletions

@ -89,6 +89,10 @@ if(MSVC)
# a smaller type, and most of the time this is just conversion from 64 to 32 bits
# for things like vector sizes, which are never that big anyway.
add_definitions("/wd4267")
# MSVC panics if an object file contains more than 65,279 sections. this
# happens quite frequently with code that uses templates, such as vectors.
add_definitions("/bigobj")
endif()
# Automatically detect architecture based on Visual Studio generator