diff --git a/CMakeLists.txt b/CMakeLists.txt index 85dc459..0adbe8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,6 +190,12 @@ elseif(OMATH_THREAT_WARNING_AS_ERROR) target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + target_compile_options(${PROJECT_NAME} PRIVATE /bigobj) +endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_HOST_SYSTEM_NAME EQUAL "Windows") + target_compile_options(${PROJECT_NAME} PRIVATE -mbig-obj) +endif() # Windows SDK redefine min/max via preprocessor and break std::min and std::max if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_definitions(${PROJECT_NAME} INTERFACE NOMINMAX)