Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang Support #84

Merged
merged 10 commits into from
Jul 31, 2024
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ if(XLINK_ENABLE_LIBUSB)
if(WIN32 AND NOT MINGW)
target_link_libraries(${TARGET_NAME} PRIVATE delayimp.lib)
# workaround https://gitlab.kitware.com/cmake/cmake/-/issues/20022
target_link_options(${TARGET_NAME} PUBLIC "$<LINK_ONLY:/DELAYLOAD:libusb-1.0$<$<CONFIG:Debug>:d>.dll>")
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# fix to https://github.com/luxonis/depthai-core/issues/1044
target_link_options(${TARGET_NAME} PUBLIC "$<LINK_ONLY:/DELAYLOAD:libusb-1.0$<$<CONFIG:Debug>:d>.dll>")
endif()
endif()
endif()

Expand Down
18 changes: 9 additions & 9 deletions src/pc/protocols/usb_host.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
// project
#define MVLOG_UNIT_NAME xLinkUsb

// std
#include <mutex>
#include <unordered_map>
#include <algorithm>
#include <string>
#include <thread>
#include <chrono>
#include <cstring>

// libraries
#ifdef XLINK_LIBUSB_LOCAL
#include <libusb.h>
Expand All @@ -15,15 +24,6 @@
#include "usb_host.h"
#include "../PlatformDeviceFd.h"

// std
#include <mutex>
#include <unordered_map>
#include <algorithm>
#include <string>
#include <thread>
#include <chrono>
#include <cstring>

constexpr static int MAXIMUM_PORT_NUMBERS = 7;
using VidPid = std::pair<uint16_t, uint16_t>;
static const int MX_ID_TIMEOUT_MS = 100;
Expand Down