Skip to content

Commit b3c2aa2

Browse files
espzavme-no-dev
andauthored
fix: Fix requires by IDF6 (#807)
* fix: Fix requires by IDF6 * Refactor CMakeLists.txt for dependency handling * Update CMakeLists to require 'driver' component * Modify priv_requires to use list append * Remove esp_driver_ledc from private requirements --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
1 parent dfeaa71 commit b3c2aa2

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# get IDF version for comparison
22
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}")
33

4+
set(priv_requires "")
5+
46
# set conversion sources
57
set(srcs
68
conversions/yuv.c
@@ -18,8 +20,6 @@ set(include_dirs
1820
conversions/include
1921
)
2022

21-
set(COMPONENT_REQUIRES driver)
22-
2323
# set driver sources only for supported platforms
2424
if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET STREQUAL "esp32s3")
2525
list(APPEND srcs
@@ -75,7 +75,7 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
7575
)
7676
endif()
7777

78-
set(priv_requires freertos nvs_flash esp_mm)
78+
list(APPEND priv_requires freertos nvs_flash esp_mm)
7979

8080
set(min_version_for_esp_timer "4.2")
8181
if (idf_version VERSION_GREATER_EQUAL min_version_for_esp_timer)
@@ -91,16 +91,18 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
9191
list(APPEND srcs driver/sccb.c)
9292
endif()
9393

94-
if (idf_version VERSION_GREATER_EQUAL "6.0")
95-
list(APPEND priv_requires esp_driver_gpio)
96-
endif()
94+
endif()
9795

96+
set(req driver)
97+
if (idf_version VERSION_GREATER_EQUAL "6.0")
98+
list(APPEND priv_requires esp_driver_gpio esp_driver_spi esp_driver_i2c)
99+
list(APPEND req esp_driver_ledc)
98100
endif()
99101

100102
idf_component_register(
101103
SRCS ${srcs}
102104
INCLUDE_DIRS ${include_dirs}
103105
PRIV_INCLUDE_DIRS ${priv_include_dirs}
104-
REQUIRES driver # due to include of driver/gpio.h in esp_camera.h
106+
REQUIRES ${req}
105107
PRIV_REQUIRES ${priv_requires}
106108
)

idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ repository: https://github.com/espressif/esp32-camera.git
66
dependencies:
77
idf: ">=5.1"
88
esp_jpeg:
9-
version: "^1.3.0"
9+
version: "^1.3.1"
1010
public: true

0 commit comments

Comments
 (0)