Skip to content

Commit cf7aad7

Browse files
committed
more esp32 cmake clean up
1 parent 641613c commit cf7aad7

File tree

9 files changed

+9
-46
lines changed

9 files changed

+9
-46
lines changed

examples/device/board_test/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
# -DFAMILY=espressif
4-
if(FAMILY STREQUAL "espressif")
5-
# TOP is absolute path to root directory of TinyUSB git repo
6-
set(TOP "../../..")
7-
get_filename_component(TOP "${TOP}" REALPATH)
8-
endif()
9-
103
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
114

125
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
idf_component_register(SRCS "main.c"
22
INCLUDE_DIRS "."
3-
REQUIRES freertos soc tinyusb_src)
4-
5-
target_include_directories(${COMPONENT_TARGET} PUBLIC
6-
"${TOP}/hw"
7-
)
3+
REQUIRES boards tinyusb_src)

examples/device/cdc_msc_freertos/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
# TOP is absolute path to root directory of TinyUSB git repo
4-
# needed for esp32sx build. TODO could be removed later on
5-
set(TOP "../../..")
6-
get_filename_component(TOP "${TOP}" REALPATH)
7-
83
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
94

105
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
idf_component_register(SRCS "main.c" "usb_descriptors.c" "msc_disk.c"
22
INCLUDE_DIRS "."
3-
REQUIRES freertos soc tinyusb_src)
4-
5-
target_include_directories(${COMPONENT_TARGET} PUBLIC
6-
"${TOP}/hw"
7-
)
3+
REQUIRES boards tinyusb_src)

examples/device/hid_composite_freertos/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
# TOP is absolute path to root directory of TinyUSB git repo
4-
# needed for esp32sx build. TODO could be removed later on
5-
set(TOP "../../..")
6-
get_filename_component(TOP "${TOP}" REALPATH)
7-
83
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
94

105
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
idf_component_register(SRCS "main.c" "usb_descriptors.c"
22
INCLUDE_DIRS "."
3-
REQUIRES freertos soc tinyusb_src)
4-
5-
target_include_directories(${COMPONENT_TARGET} PUBLIC
6-
"${TOP}/hw"
7-
)
3+
REQUIRES boards tinyusb_src)
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1+
set(hw_dir "${CMAKE_CURRENT_LIST_DIR}/../../../")
2+
13
idf_component_register(SRCS family.c
2-
INCLUDE_DIRS "." "${BOARD}"
4+
INCLUDE_DIRS "." ${BOARD} ${hw_dir}
35
PRIV_REQUIRES "driver"
46
REQUIRES led_strip src tinyusb_src)
5-
6-
target_include_directories(${COMPONENT_TARGET} PUBLIC
7-
"${TOP}/hw"
8-
)

hw/bsp/espressif/components/tinyusb_src/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ idf_build_get_property(target IDF_TARGET)
22

33
set(srcs)
44
set(includes_public)
5-
set(includes_private)
65
set(compile_options)
7-
set(tusb_src "${TOP}/src")
6+
set(tusb_src "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src")
87

98
if(target STREQUAL "esp32s3")
109
set(tusb_mcu "OPT_MCU_ESP32S3")
@@ -25,10 +24,6 @@ list(APPEND compile_options
2524

2625
idf_component_get_property(freertos_component_dir freertos COMPONENT_DIR)
2726

28-
list(APPEND includes_private
29-
"${tusb_src}"
30-
)
31-
3227
list(APPEND includes_public
3328
"${tusb_src}"
3429
# The FreeRTOS API include convention in tinyusb is different from esp-idf
@@ -54,8 +49,7 @@ list(APPEND srcs
5449

5550
idf_component_register(SRCS ${srcs}
5651
INCLUDE_DIRS ${includes_public}
57-
PRIV_INCLUDE_DIRS ${includes_private}
58-
PRIV_REQUIRES src
52+
REQUIRES src
5953
)
6054

6155
target_compile_options(${COMPONENT_LIB} PUBLIC ${compile_options})

hw/bsp/espressif/family.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
# Apply board specific content
3+
# Apply board specific content i.e IDF_TARGET must be set before project.cmake is included
44
include("${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake")
55

66
# Add example src and bsp directories

0 commit comments

Comments
 (0)