File tree Expand file tree Collapse file tree 2 files changed +34
-7
lines changed Expand file tree Collapse file tree 2 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 11idf_component_register(
22 SRCS "../hid_device/usb_descriptors.c" "tinyusb_hid.c" "usb_hid_device_main.c"
3- INCLUDE_DIRS "../hid_device"
3+ INCLUDE_DIRS "."
4+ PRIV_INCLUDE_DIRS "../hid_device"
45)
56
6- if ("${IDF_VERSION_MAJOR} .${IDF_VERSION_MINOR} " VERSION_GREATER_EQUAL "5.0" )
7- idf_component_get_property(tusb_lib espressif__tinyusb COMPONENT_LIB)
7+ # Determine whether tinyusb is fetched from component registry or from local path
8+ idf_build_get_property(build_components BUILD_COMPONENTS)
9+ if (tinyusb IN_LIST build_components)
10+ set (tinyusb_name tinyusb) # Local component
811else ()
9- idf_component_get_property(tusb_lib leeebo__tinyusb_src COMPONENT_LIB)
12+ if ("${IDF_VERSION_MAJOR} .${IDF_VERSION_MINOR} " VERSION_GREATER_EQUAL "5.0" )
13+ set (tinyusb_name espressif__tinyusb) # Managed component
14+ else ()
15+ set (tinyusb_name leeebo__tinyusb_src) # Managed component
16+ endif ()
1017endif ()
1118
19+ # Pass tusb_config.h to the example
20+ idf_component_get_property(tusb_lib ${tinyusb_name} COMPONENT_LIB)
21+ target_include_directories (${tusb_lib} INTERFACE "../hid_device" )
22+ target_link_libraries (${tusb_lib} INTERFACE ${COMPONENT_LIB} )
23+
1224cmake_policy (SET CMP0079 NEW)
13- target_link_libraries (${tusb_lib} PRIVATE ${COMPONENT_LIB} )
Original file line number Diff line number Diff line change 11idf_component_register(
22 SRCS "main.c" "usb_descriptors.c"
33 INCLUDE_DIRS "."
4+ PRIV_INCLUDE_DIRS "."
45)
56
6- idf_component_get_property(tusb_lib leeebo__tinyusb_src COMPONENT_LIB)
7+ # Determine whether tinyusb is fetched from component registry or from local path
8+ idf_build_get_property(build_components BUILD_COMPONENTS)
9+ if (tinyusb IN_LIST build_components)
10+ set (tinyusb_name tinyusb) # Local component
11+ else ()
12+ if ("${IDF_VERSION_MAJOR} .${IDF_VERSION_MINOR} " VERSION_GREATER_EQUAL "5.0" )
13+ set (tinyusb_name espressif__tinyusb) # Managed component
14+ else ()
15+ set (tinyusb_name leeebo__tinyusb_src) # Managed component
16+ endif ()
17+ endif ()
18+
19+ # Pass tusb_config.h to the example
20+ idf_component_get_property(tusb_lib ${tinyusb_name} COMPONENT_LIB)
21+ target_include_directories (${tusb_lib} INTERFACE "." )
22+ target_link_libraries (${tusb_lib} INTERFACE ${COMPONENT_LIB} )
23+
724cmake_policy (SET CMP0079 NEW)
8- target_link_libraries (${tusb_lib} PRIVATE ${COMPONENT_LIB} )
You can’t perform that action at this time.
0 commit comments