cmake: fix issue with passing cxx_std option for GCC 11, a common workaround

* Original commit: espressif/esp-idf@ea0d2123c8
This commit is contained in:
Anton Maklakov
2022-03-04 16:51:43 +07:00
committed by suren-gabrielyan-espressif
parent eb536a74a0
commit 87c269911d
2 changed files with 11 additions and 3 deletions

View File

@ -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
)

View File

@ -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
)