-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18009fa
commit 36f26fd
Showing
10 changed files
with
103 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,26 @@ | ||
include($ENV{IDF_PATH}/tools/cmake/version.cmake) | ||
set (TINYUSB_LIB) | ||
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0") | ||
set(TINYUSB_LIB "esp_tinyusb") | ||
else() | ||
set(TINYUSB_LIB "tinyusb") | ||
endif() | ||
|
||
# TODO: once IDF_v4.4 is at the EOL support, use WHOLE_ARCHIVE | ||
idf_component_register(SRCS "test_esp_tinyusb.c" "test_bvalid_sig.c" "test_app_main.c" | ||
INCLUDE_DIRS "." | ||
REQUIRES unity esp_tinyusb | ||
WHOLE_ARCHIVE) | ||
REQUIRES unity ${TINYUSB_LIB}) | ||
|
||
# In order for the cases defined by `TEST_CASE` to be linked into the final elf, | ||
# the component can be registered as WHOLE_ARCHIVE | ||
|
||
# Due to the backward compatibility to IDFv4.4 (in which WHOLE_ARCHIVE is not implemented) we use following approach: | ||
# Any non-static function from test_app/main/*.c (apart from test_app_main.c) file is added as an undefined symbol | ||
# because otherwise the linker will ignore test_app/main/*.c as it has no other files depending on any | ||
# symbols in it. | ||
|
||
# force-link test_bvalid_sig.c | ||
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u tud_mount_cb") | ||
# force-link test_esp_tinyusb.c - void function linker_hook created because: | ||
# no non-static function, no dependency to already force-linked test_bvalid_sig.c | ||
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u linker_hook") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters