Make CMake require C++17

Requires CMake 3.8+ which is the first version to support C++17 (see https://cmake.org/cmake/help/v3.8/prop_tgt/CXX_STANDARD.html).

Fixes #7749.
This commit is contained in:
TheAssassin 2018-06-30 15:13:25 +02:00 committed by GitHub
parent 13224104e4
commit 843f3a61ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,5 @@
# CMAKE project for openrct2
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.8)
if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
endif()
@ -12,6 +12,9 @@ endif ()
include(CheckCXXCompilerFlag)
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}")
set(CMAKE_MACOSX_RPATH 1)