From ea0d2123c806bd0ad77bc49843ee905cf9be65ff Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Fri, 4 Mar 2022 16:51:43 +0700 Subject: [PATCH] cmake: fix issue with passing cxx_std option for GCC 11, a common workaround --- .../host_test/components/esp_timer_linux/CMakeLists.txt | 6 +++++- .../host_test/components/freertos_linux/CMakeLists.txt | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/components/mdns/host_test/components/esp_timer_linux/CMakeLists.txt b/components/mdns/host_test/components/esp_timer_linux/CMakeLists.txt index 0c598a2e61..a2bec32aa6 100644 --- a/components/mdns/host_test/components/esp_timer_linux/CMakeLists.txt +++ b/components/mdns/host_test/components/esp_timer_linux/CMakeLists.txt @@ -2,4 +2,8 @@ idf_component_register(SRCS esp_timer_linux.c timer_task.cpp INCLUDE_DIRS include REQUIRES esp_system_protocols_linux freertos_linux) -target_compile_features(${COMPONENT_LIB} PRIVATE cxx_std_17) +set_target_properties(${COMPONENT_LIB} PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS ON +) diff --git a/components/mdns/host_test/components/freertos_linux/CMakeLists.txt b/components/mdns/host_test/components/freertos_linux/CMakeLists.txt index 7a84af21a7..cd1686154f 100644 --- a/components/mdns/host_test/components/freertos_linux/CMakeLists.txt +++ b/components/mdns/host_test/components/freertos_linux/CMakeLists.txt @@ -4,6 +4,10 @@ idf_component_register(SRCS freertos_linux.c queue_unique_ptr.cpp set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -target_link_libraries(${COMPONENT_LIB} PRIVATE Threads::Threads) +target_link_libraries(${COMPONENT_LIB} PRIVATE Threads::Threads) -target_compile_features(${COMPONENT_LIB} PRIVATE cxx_std_17) +set_target_properties(${COMPONENT_LIB} PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS ON +)