forked from espressif/esp-idf
fix: Fix protocols example to build without setting target
Protocol examples used to raise an error if the target was not set and `idf.py build` command was used. This commit fix this error and when IDF_TARGET is not set, ESP32 is selected as default target
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# CMakeLists in this exact order for cmake to work correctly
|
# CMakeLists in this exact order for cmake to work correctly
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
if(${IDF_TARGET} STREQUAL "linux")
|
if("${IDF_TARGET}" STREQUAL "linux")
|
||||||
set(COMPONENTS main)
|
set(COMPONENTS main)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -2,7 +2,9 @@
|
|||||||
#
|
#
|
||||||
# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
|
# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
|
||||||
set(requires "")
|
set(requires "")
|
||||||
if(${IDF_TARGET} STREQUAL "linux")
|
idf_build_get_property(target IDF_TARGET)
|
||||||
|
|
||||||
|
if(${target} STREQUAL "linux")
|
||||||
list(APPEND requires esp_stubs esp_event esp-tls esp_http_client protocol_examples_common nvs_flash)
|
list(APPEND requires esp_stubs esp_event esp-tls esp_http_client protocol_examples_common nvs_flash)
|
||||||
endif()
|
endif()
|
||||||
idf_component_register(SRCS "esp_http_client_example.c"
|
idf_component_register(SRCS "esp_http_client_example.c"
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
# in this exact order for cmake to work correctly
|
# in this exact order for cmake to work correctly
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
if(${IDF_TARGET} STREQUAL "linux")
|
if("${IDF_TARGET}" STREQUAL "linux")
|
||||||
set(COMPONENTS main)
|
set(COMPONENTS main)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
set(requires "")
|
set(requires "")
|
||||||
if(${IDF_TARGET} STREQUAL "linux")
|
idf_build_get_property(target IDF_TARGET)
|
||||||
|
|
||||||
|
if(${target} STREQUAL "linux")
|
||||||
list(APPEND requires esp_stubs esp-tls esp_http_server protocol_examples_common nvs_flash)
|
list(APPEND requires esp_stubs esp-tls esp_http_server protocol_examples_common nvs_flash)
|
||||||
endif()
|
endif()
|
||||||
idf_component_register(SRCS "main.c"
|
idf_component_register(SRCS "main.c"
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
if(${IDF_TARGET} STREQUAL "linux")
|
idf_build_get_property(target IDF_TARGET)
|
||||||
|
|
||||||
|
if(${target} STREQUAL "linux")
|
||||||
set(requires esp_event esp_stubs protocol_examples_common nvs_flash)
|
set(requires esp_event esp_stubs protocol_examples_common nvs_flash)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user