mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-16 12:02:11 +02:00
esp_modem(0.1.9): Fix CMake3.5 build with no cxx_std_17 feature
Older CMake (< 3.8, but still supported in IDF) doesn't support target_compile_features() for cxx_std_17. If CMake doesn't know C++17 features, set it manually via comile options.
This commit is contained in:
@ -33,7 +33,16 @@ idf_component_register(SRCS "${srcs}"
|
|||||||
PRIV_INCLUDE_DIRS private_include
|
PRIV_INCLUDE_DIRS private_include
|
||||||
REQUIRES ${dependencies})
|
REQUIRES ${dependencies})
|
||||||
|
|
||||||
|
|
||||||
|
# If CMake doesn't know C++17 features, set it manually via comile options
|
||||||
|
# esp-modem component requires C++17 internally, but older CMake (< 3.8, but still supported in IDF)
|
||||||
|
# doesn't support target_compile_features() for cxx_std_17.
|
||||||
|
get_property(cxx_known_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
|
||||||
|
if ("cxx_std_17" IN_LIST cxx_known_features)
|
||||||
target_compile_features(${COMPONENT_LIB} PRIVATE cxx_std_17)
|
target_compile_features(${COMPONENT_LIB} PRIVATE cxx_std_17)
|
||||||
|
else()
|
||||||
|
target_compile_options(${COMPONENT_LIB} PRIVATE "-std=gnu++17")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${target} STREQUAL "linux")
|
if(${target} STREQUAL "linux")
|
||||||
# This is needed for ESP_LOGx() macros, as integer formats differ on ESP32(..) and x64
|
# This is needed for ESP_LOGx() macros, as integer formats differ on ESP32(..) and x64
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
version: "0.1.8"
|
version: "0.1.9"
|
||||||
description: esp modem
|
description: esp modem
|
||||||
dependencies:
|
dependencies:
|
||||||
# Required IDF version
|
# Required IDF version
|
||||||
|
Reference in New Issue
Block a user