-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake: Add option to use bundled libusb library
- Loading branch information
Showing
8 changed files
with
85 additions
and
11 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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# CMakeLists.libusb.txt: CMake file for libusb directory | ||
|
||
set(android_tools_libusb_SOURCES | ||
libusb/libusb/core.c | ||
libusb/libusb/descriptor.c | ||
libusb/libusb/hotplug.c | ||
libusb/libusb/io.c | ||
libusb/libusb/sync.c | ||
libusb/libusb/strerror.c) | ||
|
||
if(WIN32) | ||
list(APPEND android_tools_libusb_SOURCES | ||
libusb/libusb/os/events_windows.c | ||
libusb/libusb/os/threads_windows.c | ||
libusb/libusb/os/windows_common.c | ||
libusb/libusb/os/windows_usbdk.c | ||
libusb/libusb/os/windows_winusb.c) | ||
elseif(APPLE) | ||
list(APPEND android_tools_libusb_SOURCES | ||
libusb/libusb/os/events_posix.c | ||
libusb/libusb/os/darwin_usb.c | ||
libusb/libusb/os/threads_posix.c) | ||
else() | ||
list(APPEND android_tools_libusb_SOURCES | ||
libusb/libusb/os/events_posix.c | ||
libusb/libusb/os/linux_usbfs.c | ||
libusb/libusb/os/threads_posix.c | ||
libusb/libusb/os/linux_netlink.c) | ||
endif() | ||
|
||
add_library(android_tools_libusb STATIC ${android_tools_libusb_SOURCES}) | ||
|
||
target_include_directories(android_tools_libusb PRIVATE libusb/libusb libusb/libusb/os) | ||
|
||
if(WIN32) | ||
target_include_directories(android_tools_libusb PRIVATE libusb/windows) | ||
elseif(APPLE) | ||
target_include_directories(android_tools_libusb PRIVATE libusb/darwin) | ||
|
||
target_link_libraries(android_tools_libusb PRIVATE | ||
"-framework CoreFoundation" | ||
"-framework IOKit" | ||
"-framework Security" | ||
"-lobjc") | ||
else() | ||
target_include_directories(android_tools_libusb PRIVATE libusb/linux) | ||
endif() |
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
Submodule libusb
added at
c96048