1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Add CMake version guard around setting C++ standard

It seems like CMake 3.1.3 introduced the C/C++ standard properties,
while the minimum version of this CMake file is 2.8.12. So we do what
FAudio does, which is print a warning if the CMake version is too old
and otherwise use it if we have the feature.
This commit is contained in:
Misa 2021-04-16 16:38:31 -07:00 committed by Ethan Lee
parent 575698e715
commit 4c199efbac

View file

@ -28,9 +28,12 @@ if(MAKEANDPLAY)
add_definitions(-DMAKEANDPLAY)
endif()
# Set C++ standard to C++98/C++03
set(CMAKE_CXX_STANDARD 98)
set(CMAKE_CXX_EXTENSIONS OFF) # prevent mixing stdlib implementations (dangerous!)
if(${CMAKE_VERSION} VERSION_LESS "3.1.3")
message(WARNING "Your CMake version is too old; set -std=c++98 yourself!")
else()
set(CMAKE_CXX_STANDARD 98)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# Architecture Flags
if(APPLE)