Skip to content

Commit

Permalink
cmake: Use set_target_properties to set C++ standard
Browse files Browse the repository at this point in the history
This stops dependencies from inheriting a global C++20 standard setting
and instead designates the flycast target alone to be a C++20 project.
  • Loading branch information
Wunkolo committed Dec 28, 2024
1 parent 0af6128 commit c4c53bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else()
project(flycast)
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NINTENDO_SWITCH)
set(CMAKE_CXX_EXTENSIONS ON)
Expand Down Expand Up @@ -218,6 +218,10 @@ else()
add_executable(${PROJECT_NAME} core/emulator.cpp)
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES
CMAKE_CXX_STANDARD 20
CMAKE_CXX_STANDARD_REQUIRED ON)

if(WINDOWS_STORE)
set(USE_OPENGL OFF)
set(USE_VULKAN OFF)
Expand Down

0 comments on commit c4c53bc

Please sign in to comment.