Skip to content

Commit

Permalink
Merge branch 'refactor/partition_private_includes' into 'master'
Browse files Browse the repository at this point in the history
refactor(esp_partition): Made private includes private on Linux

See merge request espressif/esp-idf!29747
  • Loading branch information
pacucha42 committed May 20, 2024
2 parents 665beae + 69c04f4 commit b24a6af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions components/esp_partition/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
set(srcs "partition.c")
set(priv_reqs esp_system bootloader_support spi_flash app_update partition_table)
set(priv_reqs esp_system spi_flash partition_table)
set(reqs)
set(include_dirs "include")
set(private_include_dirs)

idf_build_get_property(build_dir BUILD_DIR)
idf_build_get_property(target IDF_TARGET)

if(${target} STREQUAL "linux")
list(APPEND srcs "partition_linux.c")
set(priv_reqs partition_table)

# Steal some include directories from bootloader_support hal and spi_flash components:
idf_component_get_property(hal_dir hal COMPONENT_DIR)
# Steal some include directories from bootloader_support components:
idf_component_get_property(bootloader_support_dir bootloader_support COMPONENT_DIR)
idf_component_get_property(spi_flash_dir spi_flash COMPONENT_DIR)
list(APPEND include_dirs include ${hal_dir}/include ${bootloader_support_dir}/include ${spi_flash_dir}/include)
set(private_include_dirs ${bootloader_support_dir}/include)
else()
list(APPEND priv_reqs bootloader_support app_update)
list(APPEND srcs "partition_target.c")
endif()

idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS ${include_dirs}
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS ${private_include_dirs}
REQUIRES ${reqs}
PRIV_REQUIRES ${priv_reqs})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
idf_component_register(SRCS "partition_api_test.c"
REQUIRES esp_partition unity)
PRIV_REQUIRES esp_partition unity spi_flash)

# set BUILD_DIR because test uses a file created in the build directory
target_compile_definitions(${COMPONENT_LIB} PRIVATE "BUILD_DIR=\"${build_dir}\"")
1 change: 1 addition & 0 deletions components/wear_levelling/host_test/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ idf_component_register(SRCS "test_wl.cpp"
PRIV_INCLUDE_DIRS "../../private_include"
"../.."
REQUIRES wear_levelling
PRIV_REQUIRES spi_flash
WHOLE_ARCHIVE
)

Expand Down

0 comments on commit b24a6af

Please sign in to comment.