aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-10-05 11:18:52 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-10-06 08:51:47 -0600
commit3e3d249fae2bef697f30c1e32f1e84ad259e688c (patch)
tree61707f8189b74fac39505d2ef9b402b608c8a1d2
parentc9123fa78325215f14b9f034580f5b4e07a71958 (diff)
downloadusermoji-3e3d249fae2bef697f30c1e32f1e84ad259e688c.tar.xz
build: Limit control flow guard to loader/demos
Change-Id: Ibb95a7192bd95195797d3d10ccc0ed34fe030268
-rw-r--r--CMakeLists.txt8
-rw-r--r--demos/CMakeLists.txt7
-rw-r--r--loader/CMakeLists.txt7
3 files changed, 14 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1f5e758..0b4abd2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,14 +85,6 @@ if(WIN32)
# Warn about potentially uninitialized variables
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34701>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34703>")
-
- if (NOT MSVC_VERSION LESS 1900)
- # Enable control flow guard
- message(STATUS "Building with control flow guard")
- add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/guard:cf>")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf")
- endif()
endif()
if(NOT WIN32)
diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt
index b9ea9d01..eb07b4af 100644
--- a/demos/CMakeLists.txt
+++ b/demos/CMakeLists.txt
@@ -1,6 +1,13 @@
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN)
set(DisplayServer Win32)
+ if (NOT MSVC_VERSION LESS 1900)
+ # Enable control flow guard
+ message(STATUS "Building demos with control flow guard")
+ add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/guard:cf>")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf")
+ endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 0978d691..9c8173fa 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -23,6 +23,13 @@ endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN)
set(DisplayServer Win32)
+ if (NOT MSVC_VERSION LESS 1900)
+ # Enable control flow guard
+ message(STATUS "Building loader with control flow guard")
+ add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/guard:cf>")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf")
+ endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")