mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/common_components_linux' into 'master'
[build system]: Fixed common requirement for Linux target Closes IDF-3638 See merge request espressif/esp-idf!14743
This commit is contained in:
commit
b3271a51af
@ -2,4 +2,5 @@ cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
set(COMPONENTS main)
|
||||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/")
|
||||
project(test_rom_host)
|
||||
|
@ -1,2 +1,3 @@
|
||||
CONFIG_IDF_TARGET="linux"
|
||||
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
||||
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=n
|
||||
|
@ -1,12 +1,10 @@
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
set(srcs "log.c")
|
||||
set(priv_requires "")
|
||||
set(requires "")
|
||||
if(${target} STREQUAL "linux")
|
||||
# We leave log buffers out for now on Linux since it's rarely used. Excplicitely add esp_rom to Linux target
|
||||
# We leave log buffers out for now on Linux since it's rarely used. Explicitely add esp_rom to Linux target
|
||||
# since we don't have the common components there yet.
|
||||
list(APPEND srcs "log_linux.c")
|
||||
list(APPEND requires esp_rom)
|
||||
else()
|
||||
list(APPEND srcs "log_buffers.c")
|
||||
list(APPEND priv_requires soc)
|
||||
@ -15,7 +13,6 @@ endif()
|
||||
idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS "include"
|
||||
LDFRAGMENTS linker.lf
|
||||
REQUIRES ${requires}
|
||||
PRIV_REQUIRES ${priv_requires})
|
||||
|
||||
if(NOT ${target} STREQUAL "linux")
|
||||
|
@ -2,4 +2,5 @@ cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
set(COMPONENTS main)
|
||||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/")
|
||||
project(test_log_host)
|
||||
|
@ -5,3 +5,4 @@ CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y
|
||||
CONFIG_LOG_DEFAULT_LEVEL=5
|
||||
CONFIG_LOG_MAXIMUM_LEVEL=5
|
||||
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
|
||||
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=n
|
||||
|
@ -15,12 +15,6 @@ set(srcs "src/nvs_api.cpp"
|
||||
|
||||
set(public_req "spi_flash")
|
||||
|
||||
# Current linux-based builds don't have common components.
|
||||
# Add the necessary ones manually:
|
||||
if(${target} STREQUAL "linux")
|
||||
list(APPEND public_req "esp_rom" "esp_common" "log")
|
||||
endif()
|
||||
|
||||
set(include_dirs "include")
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
|
@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.5)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
set(COMPONENTS main)
|
||||
idf_component_set_property(spi_flash USE_MOCK 1)
|
||||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/driver/")
|
||||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/")
|
||||
idf_build_set_property(COMPILE_DEFINITIONS "-DNO_DEBUG_STORAGE" APPEND)
|
||||
project(host_nvs_page_test)
|
||||
|
||||
|
@ -30,17 +30,14 @@ if(${spi_flash_mock})
|
||||
"${MOCK_GEN_DIR}/Mockesp_spi_flash.c"
|
||||
"${MOCK_GEN_DIR}/Mockesp_flash.c")
|
||||
|
||||
set(requires "cmock")
|
||||
|
||||
if(${target} STREQUAL "linux")
|
||||
list(APPEND include_dirs
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../spi_flash/sim/stubs/soc/include")
|
||||
list(APPEND requires "esp_common")
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "${include_dirs}"
|
||||
REQUIRES "${requires}")
|
||||
REQUIRES "cmock")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ruby_found SYMBOLIC
|
||||
|
@ -1,3 +1,5 @@
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
|
||||
set(srcs
|
||||
"unity/src/unity.c")
|
||||
|
||||
@ -20,9 +22,7 @@ if(CONFIG_UNITY_ENABLE_FIXTURE)
|
||||
list(APPEND includes "unity/extras/fixture/src")
|
||||
endif()
|
||||
|
||||
if(${IDF_TARGET} STREQUAL "linux")
|
||||
list(APPEND requires "esp_common")
|
||||
else()
|
||||
if(NOT "${target}" STREQUAL "linux")
|
||||
list(APPEND srcs "unity_port_esp32.c")
|
||||
endif()
|
||||
|
||||
@ -30,7 +30,7 @@ idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS ${includes}
|
||||
REQUIRES ${requires})
|
||||
|
||||
if(NOT ${IDF_TARGET} STREQUAL "linux")
|
||||
if(NOT "${target}" STREQUAL "linux")
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC
|
||||
-DUNITY_INCLUDE_CONFIG_H
|
||||
)
|
||||
|
@ -10,4 +10,4 @@ idf_component_register(SRCS "gpio_cxx_test.cpp"
|
||||
"${cpp_component}/include"
|
||||
"${cpp_component}/test" # FIXME for unity_cxx.hpp, make it generally available instead
|
||||
$ENV{IDF_PATH}/tools/catch
|
||||
REQUIRES driver cmock esp_common)
|
||||
REQUIRES driver cmock)
|
||||
|
@ -126,6 +126,9 @@ endfunction()
|
||||
# properties used for the processing phase of the build.
|
||||
#
|
||||
function(__build_init idf_path)
|
||||
|
||||
set(target ${IDF_TARGET})
|
||||
|
||||
# Create the build target, to which the ESP-IDF build properties, dependencies are attached to.
|
||||
# Must be global so as to be accessible from any subdirectory in custom projects.
|
||||
add_library(__idf_build_target STATIC IMPORTED GLOBAL)
|
||||
@ -155,9 +158,10 @@ function(__build_init idf_path)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
if(NOT target STREQUAL "linux")
|
||||
if("${target}" STREQUAL "linux")
|
||||
set(requires_common freertos log esp_rom esp_common)
|
||||
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${requires_common}")
|
||||
else()
|
||||
# Set components required by all other components in the build
|
||||
#
|
||||
# - lwip is here so that #include <sys/socket.h> works without any special provisions
|
||||
@ -411,10 +415,8 @@ macro(idf_build_process target)
|
||||
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
|
||||
if(NOT target STREQUAL "linux")
|
||||
if(NOT "${target}" STREQUAL "linux")
|
||||
idf_build_set_property(__COMPONENT_REQUIRES_COMMON ${target} APPEND)
|
||||
else()
|
||||
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "")
|
||||
endif()
|
||||
|
||||
# Call for component manager to download dependencies for all components
|
||||
|
@ -1,6 +1,11 @@
|
||||
# Designed to be included from an IDF app's CMakeLists.txt file
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/targets.cmake)
|
||||
# Initialize build target for this build using the environment variable or
|
||||
# value passed externally.
|
||||
__target_init()
|
||||
|
||||
# The mere inclusion of this CMake file sets up some interal build properties.
|
||||
# These properties can be modified in between this inclusion the the idf_build_process
|
||||
# call.
|
||||
@ -33,10 +38,6 @@ else()
|
||||
idf_build_set_property(EXTRA_CMAKE_ARGS "")
|
||||
endif()
|
||||
|
||||
# Initialize build target for this build using the environment variable or
|
||||
# value passed externally.
|
||||
__target_init()
|
||||
|
||||
#
|
||||
# Get the project version from either a version file or the Git revision. This is passed
|
||||
# to the idf_build_process call. Dependencies are also set here for when the version file
|
||||
@ -172,7 +173,6 @@ function(__project_init components_var test_components_var)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
# Add component directories to the build, given the component filters, exclusions
|
||||
# extra directories, etc. passed from the root CMakeLists.txt.
|
||||
if(COMPONENT_DIRS)
|
||||
|
Loading…
Reference in New Issue
Block a user