2021-04-04 22:15:46 +02:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
|
|
|
if(${target} STREQUAL "linux")
|
|
|
|
set(platform_srcs src/esp_modem_primitives_linux.cpp
|
|
|
|
src/esp_modem_uart_linux.cpp
|
|
|
|
src/esp_modem_netif_linux.cpp)
|
|
|
|
set(dependencies esp_system_protocols_linux)
|
|
|
|
else()
|
|
|
|
set(platform_srcs src/esp_modem_primitives_freertos.cpp
|
|
|
|
src/esp_modem_uart.cpp
|
2021-05-13 07:28:05 +02:00
|
|
|
src/esp_modem_term_uart.cpp
|
2021-04-04 22:15:46 +02:00
|
|
|
src/esp_modem_netif.cpp)
|
|
|
|
set(dependencies driver)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(srcs ${platform_srcs}
|
|
|
|
"src/esp_modem_dte.cpp"
|
2021-03-24 21:06:27 +01:00
|
|
|
"src/esp_modem_dce.cpp"
|
2021-03-03 20:35:08 +01:00
|
|
|
"src/esp_modem_api.cpp"
|
2021-04-15 09:46:28 +02:00
|
|
|
"src/esp_modem_c_api.cpp"
|
2021-03-07 19:43:45 +01:00
|
|
|
"src/esp_modem_factory.cpp"
|
2021-03-04 20:19:18 +01:00
|
|
|
"src/esp_modem_cmux.cpp"
|
2021-03-07 19:43:45 +01:00
|
|
|
"src/esp_modem_command_library.cpp"
|
2021-05-06 18:57:07 +02:00
|
|
|
"src/esp_modem_term_fs.cpp"
|
2021-05-23 20:43:50 +02:00
|
|
|
"src/esp_modem_vfs_uart_creator.cpp"
|
|
|
|
"src/esp_modem_vfs_socket_creator.cpp"
|
2021-04-04 22:15:46 +02:00
|
|
|
"src/esp_modem_modules.cpp")
|
2020-11-18 21:20:35 +01:00
|
|
|
|
|
|
|
set(include_dirs "include")
|
|
|
|
|
2020-11-18 21:15:08 +01:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
2020-11-18 21:20:35 +01:00
|
|
|
INCLUDE_DIRS "${include_dirs}"
|
2020-11-18 21:15:08 +01:00
|
|
|
PRIV_INCLUDE_DIRS private_include
|
2021-04-04 22:15:46 +02:00
|
|
|
REQUIRES ${dependencies})
|
2021-02-26 18:32:15 +01:00
|
|
|
|
2021-07-29 16:16:15 +02:00
|
|
|
|
|
|
|
# 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)
|
|
|
|
else()
|
|
|
|
target_compile_options(${COMPONENT_LIB} PRIVATE "-std=gnu++17")
|
|
|
|
endif()
|
2021-05-15 22:09:08 +02:00
|
|
|
|
2021-05-19 07:28:40 +02:00
|
|
|
if(${target} STREQUAL "linux")
|
|
|
|
# This is needed for ESP_LOGx() macros, as integer formats differ on ESP32(..) and x64
|
|
|
|
set_target_properties(${COMPONENT_LIB} PROPERTIES COMPILE_FLAGS -Wno-format)
|
|
|
|
endif()
|