diff --git a/cpp/evolution/v0/generated/CMakeLists.txt b/cpp/evolution/v0/generated/CMakeLists.txt index f36a5287..c10f54a5 100644 --- a/cpp/evolution/v0/generated/CMakeLists.txt +++ b/cpp/evolution/v0/generated/CMakeLists.txt @@ -43,3 +43,4 @@ endif() add_library(evo_test_generated_v0 OBJECT ${EvoTest_GENERATED_SOURCES}) target_link_libraries(evo_test_generated_v0 ${EvoTest_GENERATED_LINK_LIBRARIES}) +target_compile_features(evo_test_generated_v0 PUBLIC cxx_std_17) diff --git a/cpp/evolution/v1/generated/CMakeLists.txt b/cpp/evolution/v1/generated/CMakeLists.txt index 5e4ff916..84b50f5c 100644 --- a/cpp/evolution/v1/generated/CMakeLists.txt +++ b/cpp/evolution/v1/generated/CMakeLists.txt @@ -43,3 +43,4 @@ endif() add_library(evo_test_generated_v1 OBJECT ${EvoTest_GENERATED_SOURCES}) target_link_libraries(evo_test_generated_v1 ${EvoTest_GENERATED_LINK_LIBRARIES}) +target_compile_features(evo_test_generated_v1 PUBLIC cxx_std_17) diff --git a/cpp/evolution/v2/generated/CMakeLists.txt b/cpp/evolution/v2/generated/CMakeLists.txt index a314542a..04c83a24 100644 --- a/cpp/evolution/v2/generated/CMakeLists.txt +++ b/cpp/evolution/v2/generated/CMakeLists.txt @@ -43,3 +43,4 @@ endif() add_library(evo_test_generated OBJECT ${EvoTest_GENERATED_SOURCES}) target_link_libraries(evo_test_generated ${EvoTest_GENERATED_LINK_LIBRARIES}) +target_compile_features(evo_test_generated PUBLIC cxx_std_17) diff --git a/cpp/test/generated/CMakeLists.txt b/cpp/test/generated/CMakeLists.txt index c47c420e..1437469e 100644 --- a/cpp/test/generated/CMakeLists.txt +++ b/cpp/test/generated/CMakeLists.txt @@ -45,6 +45,7 @@ list(APPEND TestModel_GENERATED_SOURCES factories.cc translator_impl.cc) add_library(test_model_generated OBJECT ${TestModel_GENERATED_SOURCES}) target_link_libraries(test_model_generated ${TestModel_GENERATED_LINK_LIBRARIES}) +target_compile_features(test_model_generated PUBLIC cxx_std_17) add_library(test_model_generated_mocks OBJECT mocks.cc) target_link_libraries(test_model_generated_mocks diff --git a/tooling/internal/cpp/cmake.go b/tooling/internal/cpp/cmake.go index 14e65f3d..fbcb246f 100644 --- a/tooling/internal/cpp/cmake.go +++ b/tooling/internal/cpp/cmake.go @@ -81,6 +81,7 @@ endif() fmt.Fprintf(w, "add_library(%s OBJECT ${%s_SOURCES})\n", objectLibraryName, cmakePrefix) fmt.Fprintf(w, "target_link_libraries(%s ${%s_LINK_LIBRARIES})\n", objectLibraryName, cmakePrefix) + fmt.Fprintf(w, "target_compile_features(%s PUBLIC cxx_std_17)\n", objectLibraryName) if options.InternalGenerateMocks { w.WriteStringln("")