aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2016-01-18 17:22:48 -0700
committerMark Young <marky@lunarg.com>2016-01-25 11:01:48 -0700
commit0ff2a1c236fe6633a2dca1fc3cc2ea65952edf75 (patch)
tree83f99ad112ba14eae96c4d1efad55afa7553e465 /layers
parent3436411618198419a66070428926465654ab74ce (diff)
downloadusermoji-0ff2a1c236fe6633a2dca1fc3cc2ea65952edf75.tar.xz
BUILD: Fix build of draw_state.cpp with VS 2015.
Added /bigobj to Debug build of all layer files when using VS 2015 or newer.
Diffstat (limited to 'layers')
-rw-r--r--layers/CMakeLists.txt17
1 files changed, 15 insertions, 2 deletions
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index b5933578..44345d62 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -88,8 +88,21 @@ include_directories(
)
if (WIN32)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_CRT_SECURE_NO_WARNINGS")
+ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D_CRT_SECURE_NO_WARNINGS")
+
+ # For VS 2015, which uses compiler version 1900, draw_state.cpp fails with too many objects
+ # without either optimizations enabled, or setting the /bigobj compilation option. Since
+ # optimizations are enabled in a release build, this only affects the debug build. For now,
+ # enable /bigobj mode for all debug layer files. An alternative for the future is to split
+ # draw_state.cpp into multiple files, which will also alleviate the compilation error.
+ if (NOT (MSVC_VERSION LESS 1900))
+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS /bigobj")
+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS /bigobj")
+ else()
+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS")
+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS")
+ endif()
endif()
if (NOT WIN32)
set (CMAKE_CXX_FLAGS "-std=c++11")