diff --git a/CMakeLists.txt b/CMakeLists.txt index 48ce456ea..190f6831a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,7 +253,7 @@ add_subdirectory(thirdparty) target_link_libraries(${SD_LIB} PUBLIC ggml zip) target_include_directories(${SD_LIB} PUBLIC . src include) target_include_directories(${SD_LIB} PUBLIC . thirdparty) -target_compile_features(${SD_LIB} PUBLIC c_std_11 cxx_std_17) +set_target_properties(${SD_LIB} PROPERTIES C_STANDARD 11 C_STANDARD_REQUIRED ON CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) if (SD_BUILD_EXAMPLES) diff --git a/examples/cli/CMakeLists.txt b/examples/cli/CMakeLists.txt index db1f4ca37..655ab8331 100644 --- a/examples/cli/CMakeLists.txt +++ b/examples/cli/CMakeLists.txt @@ -17,4 +17,4 @@ if(SD_WEBM) target_compile_definitions(${TARGET} PRIVATE SD_USE_WEBM) target_link_libraries(${TARGET} PRIVATE webm) endif() -target_compile_features(${TARGET} PUBLIC c_std_11 cxx_std_17) +set_target_properties(${TARGET} PROPERTIES C_STANDARD 11 C_STANDARD_REQUIRED ON CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index b70b525e5..0a781f408 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -101,4 +101,4 @@ if(WIN32 AND NOT MSVC) target_link_libraries(${TARGET} PRIVATE ws2_32) endif() -target_compile_features(${TARGET} PUBLIC c_std_11 cxx_std_17) +set_target_properties(${TARGET} PROPERTIES C_STANDARD 11 C_STANDARD_REQUIRED ON CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 4dfdf0d29..23fe1e28c 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -37,9 +37,9 @@ if(SD_WEBM AND NOT SD_USE_SYSTEM_WEBM) # C++11. Restore the parent flags so the main project keeps its own C++17 # requirements, then pin the libwebm targets to C++17 explicitly. set(CMAKE_CXX_FLAGS "${SD_LIBWEBM_PARENT_CXX_FLAGS}" CACHE STRING "" FORCE) - target_compile_features(mkvmuxer PRIVATE cxx_std_17) - target_compile_features(mkvparser PRIVATE cxx_std_17) - target_compile_features(webm PRIVATE cxx_std_17) + set_target_properties(mkvmuxer PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) + set_target_properties(mkvparser PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) + set_target_properties(webm PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) target_include_directories(webm INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libwebm) endif()