mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
cmake: Require cmake 3.15 for MSVC
We need these policies, but we kind of want to avoid requiring cmake 3.15 for all platforms
This commit is contained in:
parent
876f6651b4
commit
4db1816368
@ -16,8 +16,12 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14.0" CACHE STRING "")
|
||||
|
||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE "CMake/FlagsOverride.cmake")
|
||||
|
||||
# Required for cmake to select the correct runtime library in MSVC builds.
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
# Optionally enable these polcies so older versions of cmake don't break.
|
||||
# we only need them for MSVC
|
||||
if(POLICY CMP0091)
|
||||
cmake_policy(SET CMP0091 NEW) # MSVC runtime library flags are selected by an abstraction.
|
||||
cmake_policy(SET CMP0092 NEW) # MSVC warning flags are not in CMAKE_{C,CXX}_FLAGS by default.
|
||||
endif()
|
||||
|
||||
project(dolphin-emu)
|
||||
|
||||
@ -247,7 +251,14 @@ elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
add_compile_options("/MP")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||
if(MSVC)
|
||||
if(POLICY CMP0091)
|
||||
# cmake is a weird language. You can't do if(not POLICY)
|
||||
else()
|
||||
# We really kind of want this policy
|
||||
message(FATAL_ERROR "please update cmake to at least 3.15")
|
||||
endif()
|
||||
|
||||
check_and_add_flag(EXCEPTIONS /EHsc)
|
||||
dolphin_compile_definitions(_DEBUG DEBUG_ONLY)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user