From a513d3191e1846df6602370c30d700eaf9a5d07a Mon Sep 17 00:00:00 2001 From: EoD Date: Sun, 31 Jul 2016 01:00:38 +0200 Subject: [PATCH] Add C++11 in cmake as default Currently, the build is broken on Linux as fixed width integers (for example uint32) are used via without a namespace. This is only allowed in C++11 and later. See http://en.cppreference.com/w/cpp/types/integer for details. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4318c6b1..ece4cb40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # The project's name is VBA-M it uses C and C++ code PROJECT(VBA-M C CXX) -cmake_minimum_required( VERSION 2.6.0 ) +cmake_minimum_required( VERSION 3.1.0 ) if( COMMAND cmake_policy ) cmake_policy( SET CMP0003 NEW ) cmake_policy( SET CMP0005 OLD ) @@ -491,6 +491,8 @@ ADD_LIBRARY ( ${SRC_DEBUGGER} ${HDR_DEBUGGER} ) +set_property(TARGET vbamcore PROPERTY CXX_STANDARD 11) +set_property(TARGET vbamcore PROPERTY CXX_STANDARD_REQUIRED ON) IF( ENABLE_SDL ) ADD_EXECUTABLE ( @@ -499,6 +501,8 @@ IF( ENABLE_SDL ) ${SRC_SDL} ${HDR_SDL} ) + set_property(TARGET vbam PROPERTY CXX_STANDARD 11) + set_property(TARGET vbam PROPERTY CXX_STANDARD_REQUIRED ON) IF( WIN32 ) SET( WIN32_LIBRARIES wsock32 )