mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-20 00:36:01 -04:00
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:
parent
7a32d72409
commit
7decf3e344
@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
if(${IDF_TARGET} STREQUAL "linux")
|
||||
if("${IDF_TARGET}" STREQUAL "linux")
|
||||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/"
|
||||
"$ENV{IDF_PATH}/examples/protocols/linux_stubs/esp_stubs")
|
||||
set(COMPONENTS main)
|
||||
|
@ -2,7 +2,9 @@
|
||||
#
|
||||
# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
|
||||
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_client protocol_examples_common nvs_flash)
|
||||
endif()
|
||||
idf_component_register(SRCS "esp_http_client_example.c"
|
||||
|
@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
if(${IDF_TARGET} STREQUAL "linux")
|
||||
if("${IDF_TARGET}" STREQUAL "linux")
|
||||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/"
|
||||
"$ENV{IDF_PATH}/examples/protocols/linux_stubs/esp_stubs")
|
||||
set(COMPONENTS main)
|
||||
|
@ -1,5 +1,7 @@
|
||||
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)
|
||||
endif()
|
||||
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_stubs protocol_examples_common nvs_flash)
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user