Skip to content

Commit

Permalink
Use C++17 standard
Browse files Browse the repository at this point in the history
Also use simpler target_compile_features.  The comment says this
requires CMake 3.8, but that is less than our minimum required CMake
version, so it should be fine.
  • Loading branch information
zpostfacto committed Aug 5, 2023
1 parent ebe5889 commit 800a158
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,6 @@ if(USE_STEAMWEBRTC)
add_subdirectory(external/steamwebrtc)
endif(USE_STEAMWEBRTC)

set(C99_FEATURES
c_restrict
c_function_prototypes)

set(CXX11_FEATURES
cxx_constexpr
cxx_auto_type)

set(GNS_COMMON_FLAGS
-fvisibility=hidden
-fno-strict-aliasing
Expand Down Expand Up @@ -264,11 +256,7 @@ macro(set_clientlib_target_properties GNS_TARGET)
)
endif()

## Needs CMake 3.8, then we could get rid of the workaround below it.
#target_compile_features(${GNS_TARGET} PUBLIC c_std_99 cxx_std_11)
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_features(${GNS_TARGET} PUBLIC ${C99_FEATURES} ${CXX11_FEATURES})
endif()
target_compile_features(${GNS_TARGET} PUBLIC c_std_99 cxx_std_17)

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU"
OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down

0 comments on commit 800a158

Please sign in to comment.