build: set cmake C++ version to 17, fix Mac build
Fix Mac build regression caused by 2407923f
(build: fix cmake version
warnings, 2023-08-26) due to vbamcore and vbam targets using C++11 but
no longer being compatible with it.
When cmake_minimum_required() was set to a much older version, the
CXX_STANDARD property for vbamcore and vbam were ignored.
With the change mentioned above setting a higher
cmake_minimum_required(), the -std=gnu++11 flag started being passed when
compiling these two targets, making them fail due to recent changes no
longer being C++11 compatible.
Set cmake_minimum_required() to 3.8.2, the first version of cmake
supporting C++17, remove the CXX_STANDARD and CXX_STANDARD_REQUIRED
properties from these two targets, and set CMAKE_CXX_STANDARD to 17 to
set this property to C++17 for all targets in the project.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
2407923fc0
commit
cd8d65bddd
|
@ -74,7 +74,9 @@ if(NOT CMAKE_CXX_COMPILER_LAUNCHER)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.8.2)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
project(VBA-M C CXX)
|
||||
|
||||
|
@ -1175,8 +1177,6 @@ if(NOT TRANSLATIONS_ONLY)
|
|||
${HDR_STB_IMAGE}
|
||||
)
|
||||
add_dependencies(vbamcore generate)
|
||||
set_property(TARGET vbamcore PROPERTY CXX_STANDARD 11)
|
||||
set_property(TARGET vbamcore PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
if((NOT TRANSLATIONS_ONLY) AND ENABLE_SDL)
|
||||
|
@ -1186,8 +1186,6 @@ if((NOT TRANSLATIONS_ONLY) AND 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 ws2_32 winmm version imm32)
|
||||
|
|
Loading…
Reference in New Issue