summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-27 20:51:03 -0700
committerStanislaw Halik <sthalik@misaki.pl>2013-10-27 20:51:03 -0700
commit04c49d4406031c2fac9cee97bbfaaf19c5e9be9a (patch)
treec2a47005cd5200d927b72e51187d1322d4eeebdd
parent4b2a9abcd44292f6f2b9f119f68c39e27cd536a5 (diff)
parentfbb15a3b322727370ed1d52ef4e2b28ffed8ddae (diff)
Merge pull request #6 from alterscape/msvc2012_compat
Fix MSVC2012 build
-rw-r--r--CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58fbfc60..76a917a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,27 @@ if(SDK_GOOGLE_BREAKPAD AND WIN32)
include_directories("${SDK_GOOGLE_BREAKPAD}/src/")
endif()
+if (WIN32 AND DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700)
+ find_path (WIN8_SDK_ROOT_DIR
+ Include/um/windows.h
+ PATHS
+ "$ENV{ProgramFiles}/Windows Kits/8.0"
+ "$ENV{ProgramFiles(x86)}/Windows Kits/8.0"
+ DOC "Windows 8 SDK root directory"
+ )
+
+ if (WIN8_SDK_ROOT_DIR)
+ SET(CMAKE_LIBRARY_PATH "${WIN8_SDK_ROOT_DIR}/Lib/win8/um/x86")
+ endif ()
+ endif ()
+endif()
+
+if(WIN32 AND DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700)
+ SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
+ SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
+ SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
+endif()
+
if(UNIX)
set(SDK_ENABLE_LIBEVDEV FALSE CACHE BOOL "libevdev virtual joystick protocol support (probably Linux only)")
endif()