Skip to content

Commit

Permalink
Enable CPP17 Build
Browse files Browse the repository at this point in the history
This was maybe enabled before, but due to some edgecases around default versions it seems to have broken at some point. Doing this seems to have fixed it so that `-std=gnu++17` is present in the compile_commands.json file now.
  • Loading branch information
AsherGlick committed Oct 31, 2023
1 parent f38417d commit 3351912
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xml_converter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required (VERSION 3.16)
project (XMLConverter)

# Set CPP standard library to cpp17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)


Expand All @@ -23,8 +27,6 @@ add_library(${CORE_LIB} STATIC ${SOURCES} ${PROTO_SRC})
# Include protobuf libraies.
target_link_libraries(${CORE_LIB} PUBLIC ${Protobuf_LIBRARIES})

# Require C++ 17 or newer.
target_compile_features(${CORE_LIB} PUBLIC cxx_std_17)
if(MSVC)
target_compile_options(${CORE_LIB} PUBLIC /W4 /WX)
else()
Expand Down

0 comments on commit 3351912

Please sign in to comment.