File tree Expand file tree Collapse file tree 9 files changed +9
-46
lines changed Expand file tree Collapse file tree 9 files changed +9
-46
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.5 )
2
2
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
-
10
3
include (${CMAKE_CURRENT_SOURCE_DIR} /../../../hw/bsp/family_support.cmake )
11
4
12
5
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
Original file line number Diff line number Diff line change 1
1
idf_component_register (SRCS "main.c"
2
2
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 )
Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.5 )
2
2
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
-
8
3
include (${CMAKE_CURRENT_SOURCE_DIR} /../../../hw/bsp/family_support.cmake )
9
4
10
5
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
Original file line number Diff line number Diff line change 1
1
idf_component_register (SRCS "main.c" "usb_descriptors.c" "msc_disk.c"
2
2
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 )
Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.5 )
2
2
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
-
8
3
include (${CMAKE_CURRENT_SOURCE_DIR} /../../../hw/bsp/family_support.cmake )
9
4
10
5
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
Original file line number Diff line number Diff line change 1
1
idf_component_register (SRCS "main.c" "usb_descriptors.c"
2
2
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 )
Original file line number Diff line number Diff line change
1
+ set (hw_dir "${CMAKE_CURRENT_LIST_DIR} /../../../" )
2
+
1
3
idf_component_register (SRCS family.c
2
- INCLUDE_DIRS "." " ${BOARD} "
4
+ INCLUDE_DIRS "." ${BOARD} ${hw_dir}
3
5
PRIV_REQUIRES "driver"
4
6
REQUIRES led_strip src tinyusb_src )
5
-
6
- target_include_directories (${COMPONENT_TARGET} PUBLIC
7
- "${TOP} /hw"
8
- )
Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ idf_build_get_property(target IDF_TARGET)
2
2
3
3
set (srcs )
4
4
set (includes_public )
5
- set (includes_private )
6
5
set (compile_options )
7
- set (tusb_src "${TOP} /src" )
6
+ set (tusb_src "${CMAKE_CURRENT_SOURCE_DIR} /../../../../.. /src" )
8
7
9
8
if (target STREQUAL "esp32s3" )
10
9
set (tusb_mcu "OPT_MCU_ESP32S3" )
@@ -25,10 +24,6 @@ list(APPEND compile_options
25
24
26
25
idf_component_get_property (freertos_component_dir freertos COMPONENT_DIR )
27
26
28
- list (APPEND includes_private
29
- "${tusb_src} "
30
- )
31
-
32
27
list (APPEND includes_public
33
28
"${tusb_src} "
34
29
# The FreeRTOS API include convention in tinyusb is different from esp-idf
@@ -54,8 +49,7 @@ list(APPEND srcs
54
49
55
50
idf_component_register (SRCS ${srcs}
56
51
INCLUDE_DIRS ${includes_public}
57
- PRIV_INCLUDE_DIRS ${includes_private}
58
- PRIV_REQUIRES src
52
+ REQUIRES src
59
53
)
60
54
61
55
target_compile_options (${COMPONENT_LIB} PUBLIC ${compile_options} )
Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.5 )
2
2
3
- # Apply board specific content
3
+ # Apply board specific content i.e IDF_TARGET must be set before project.cmake is included
4
4
include ("${CMAKE_CURRENT_LIST_DIR} /boards/${BOARD} /board.cmake" )
5
5
6
6
# Add example src and bsp directories
You can’t perform that action at this time.
0 commit comments