diff options
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | cmake/FindDirectX.cmake | 2 | ||||
-rw-r--r-- | cmake/Windows10SDK.cmake | 53 | ||||
-rw-r--r-- | docs/INSTALL.markdown | 2 | ||||
-rw-r--r-- | retrace/glstate_formats.cpp | 9 |
5 files changed, 6 insertions, 74 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c67f0d2d..500eedde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,11 +124,9 @@ if (ENABLE_GUI) endif () if (MSVC) - if (${MSVC_VERSION} LESS 1800) - message (FATAL_ERROR "Visual Studio 2013 or later required") + if (${MSVC_VERSION} LESS 1900) + message (FATAL_ERROR "Visual Studio 2015 or later required") endif () - - include (Windows10SDK) endif () if (WIN32) @@ -149,12 +147,8 @@ if (WIN32) if (WINDOWS_XP) set (DirectX_D3D11_3_INCLUDE_FOUND FALSE) - elseif (DEFINED MSVC_VERSION AND NOT DirectX_D3D11_3_INCLUDE_FOUND) - if (${MSVC_VERSION} LESS 1900) - message (FATAL_ERROR "Windows 10 SDK (https://dev.windows.com/en-us/downloads/windows-10-sdk) must be installed for D3D11.3 support") - else () - message (FATAL_ERROR "Windows 10 SDK must be selected (-DCMAKE_SYSTEM_VERSION=10.0) for D3D11.3 support") - endif () + elseif (MSVC AND NOT DirectX_D3D11_3_INCLUDE_FOUND) + message (FATAL_ERROR "Windows 10 SDK must be selected (-DCMAKE_SYSTEM_VERSION=10.0) for D3D11.3 support") endif () set (ENABLE_EGL false) diff --git a/cmake/FindDirectX.cmake b/cmake/FindDirectX.cmake index 34dbdd8c..f4d9dddd 100644 --- a/cmake/FindDirectX.cmake +++ b/cmake/FindDirectX.cmake @@ -74,7 +74,7 @@ if (WIN32) # # See also: # - http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx - if (DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700) + if (MSVC) set (USE_WINSDK_HEADERS TRUE) endif () diff --git a/cmake/Windows10SDK.cmake b/cmake/Windows10SDK.cmake deleted file mode 100644 index df189d5e..00000000 --- a/cmake/Windows10SDK.cmake +++ /dev/null @@ -1,53 +0,0 @@ -# - try to find and use Windows 10 SDK on VS 2013 -# -# VS 2013 will never pick Windows 10 SDK -- one must manually set the include and library directories. -# -# See also: -# - https://github.com/walbourn/directx-sdk-samples/commit/68575c40984f2581e3931157bd7e9f831ba70d69 -# - http://stackoverflow.com/a/28922582 -# - http://blogs.msdn.com/b/vcblog/archive/2012/11/23/using-the-windows-8-sdk-with-visual-studio-2010-configuring-multiple-projects.aspx - -if (MSVC AND ${MSVC_VERSION} LESS 1900 AND NOT CMAKE_GENERATOR_TOOLSET MATCHES "_xp$") - - include (FindPackageMessage) - - # Can't use "$ENV{ProgramFiles(x86)}" to avoid violating CMP0053. See - # http://public.kitware.com/pipermail/cmake-developers/2014-October/023190.html - set (ProgramFiles_x86 "ProgramFiles(x86)") - if ("$ENV{${ProgramFiles_x86}}") - set (ProgramFiles "$ENV{${ProgramFiles_x86}}") - else () - set (ProgramFiles "$ENV{ProgramFiles}") - endif () - - set (WIN10_SDK_VER "10.0.10240.0") - - find_path (WIN10_SDK_ROOT_DIR - SDKManifest.xml - PATHS - "${ProgramFiles}/Windows Kits/10" - DOC "Windows 10 SDK root directory" - ) - - if (CMAKE_SIZEOF_VOID_P EQUAL 4) - set (WIN10_SDK_ARCH x86) - else () - set (WIN10_SDK_ARCH x64) - endif () - - if (WIN10_SDK_ROOT_DIR) - find_package_message (WIN10_SDK "Windows 10 SDK - found: ${WIN10_SDK_ROOT_DIR}" "[${WIN10_SDK_ROOT_DIR}]") - set (WIN10_SDK_INC_DIRS - "${WIN10_SDK_ROOT_DIR}/Include/${WIN10_SDK_VER}/um" - "${WIN10_SDK_ROOT_DIR}/Include/${WIN10_SDK_VER}/shared" - "${WIN10_SDK_ROOT_DIR}/Include/${WIN10_SDK_VER}/winrt" - ) - include_directories (BEFORE ${WIN10_SDK_INC_DIRS}) - list (APPEND CMAKE_REQUIRED_INCLUDES ${WIN10_SDK_INC_DIRS}) - link_directories ( - ${WIN10_SDK_ROOT_DIR}/Lib/${WIN10_SDK_VER}/${WIN10_SDK_ARCH} - ) - else () - find_package_message (WIN10_SDK "Windows 10 SDK - not found" "[]") - endif () -endif () diff --git a/docs/INSTALL.markdown b/docs/INSTALL.markdown index 7291708f..f5500aee 100644 --- a/docs/INSTALL.markdown +++ b/docs/INSTALL.markdown @@ -136,7 +136,7 @@ Additional requirements: * CMake 3.4 or later -* Microsoft Visual Studio 2013 or newer (instructions presume 2015) +* Microsoft Visual Studio 2015 or newer (instructions presume 2015) * [Windows 10 SDK](https://dev.windows.com/en-us/downloads/windows-10-sdk) for D3D11.3 headers. diff --git a/retrace/glstate_formats.cpp b/retrace/glstate_formats.cpp index 24f5b08c..8f57c0e2 100644 --- a/retrace/glstate_formats.cpp +++ b/retrace/glstate_formats.cpp @@ -495,21 +495,12 @@ protected: scale(Scale value, typename std::enable_if<normalized, T>::type* = 0) { static_assert( normalized, "should only be instantiated for normalized types" ); -#ifndef _MSC_VER static constexpr Type typeMax = std::numeric_limits<Type>::max(); static_assert( static_cast<Type>(static_cast<Scale>(typeMax)) == typeMax, "intermediate type cannot represent maximum value without loss of precission" ); static constexpr Scale scaleFactor = Scale(1) / Scale(typeMax); static_assert( Scale(typeMax) * scaleFactor == Scale(1), "cannot represent unity" ); static_assert( Scale(0) * scaleFactor == Scale(0), "cannot represent zero" ); -#else - // XXX: MSCV doesn't support constexpr yet - static const Type typeMax = std::numeric_limits<Type>::max(); - assert( static_cast<Type>(static_cast<Scale>(typeMax)) == typeMax ); - static const Scale scaleFactor = Scale(1) / Scale(typeMax); - assert( Scale(typeMax) * scaleFactor == Scale(1) ); - assert( Scale(0) * scaleFactor == Scale(0) ); -#endif return value * scaleFactor; } |