summaryrefslogtreecommitdiff
path: root/externals
diff options
context:
space:
mode:
Diffstat (limited to 'externals')
m---------externals/libusb0
-rw-r--r--externals/libusb/CMakeLists.txt150
-rw-r--r--externals/libusb/config.h.in90
m---------externals/libusb/libusb0
-rw-r--r--externals/microprofile/microprofile.h2
m---------externals/xbyak0
6 files changed, 241 insertions, 1 deletions
diff --git a/externals/libusb b/externals/libusb
deleted file mode 160000
Subproject 3406d72cda879f8792a88bf5f6bd0b7a65636f7
diff --git a/externals/libusb/CMakeLists.txt b/externals/libusb/CMakeLists.txt
new file mode 100644
index 000000000..c0d24b126
--- /dev/null
+++ b/externals/libusb/CMakeLists.txt
@@ -0,0 +1,150 @@
1add_library(usb STATIC EXCLUDE_FROM_ALL
2 libusb/libusb/core.c
3 libusb/libusb/core.c
4 libusb/libusb/descriptor.c
5 libusb/libusb/hotplug.c
6 libusb/libusb/io.c
7 libusb/libusb/strerror.c
8 libusb/libusb/sync.c
9)
10set_target_properties(usb PROPERTIES VERSION 1.0.23)
11if(WIN32)
12 target_include_directories(usb
13 BEFORE
14 PUBLIC
15 libusb/libusb
16
17 PRIVATE
18 "${CMAKE_CURRENT_BINARY_DIR}"
19 )
20
21 if (NOT MINGW)
22 target_include_directories(usb BEFORE PRIVATE libusb/msvc)
23 endif()
24
25 # Works around other libraries providing their own definition of USB GUIDs (e.g. SDL2)
26 target_compile_definitions(usb PRIVATE "-DGUID_DEVINTERFACE_USB_DEVICE=(GUID){ 0xA5DCBF10, 0x6530, 0x11D2, {0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED}}")
27else()
28target_include_directories(usb
29 # turns out other projects also have "config.h", so make sure the
30 # LibUSB one comes first
31 BEFORE
32
33 PUBLIC
34 libusb/libusb
35
36 PRIVATE
37 "${CMAKE_CURRENT_BINARY_DIR}"
38)
39endif()
40
41if(WIN32 OR CYGWIN)
42 target_sources(usb PRIVATE
43 libusb/libusb/os/threads_windows.c
44 libusb/libusb/os/windows_winusb.c
45 libusb/libusb/os/windows_usbdk.c
46 libusb/libusb/os/windows_nt_common.c
47 )
48 set(OS_WINDOWS TRUE)
49elseif(APPLE)
50 target_sources(usb PRIVATE
51 libusb/libusb/os/darwin_usb.c
52 )
53 find_library(COREFOUNDATION_LIBRARY CoreFoundation)
54 find_library(IOKIT_LIBRARY IOKit)
55 find_library(OBJC_LIBRARY objc)
56 target_link_libraries(usb PRIVATE
57 ${COREFOUNDATION_LIBRARY}
58 ${IOKIT_LIBRARY}
59 ${OBJC_LIBRARY}
60 )
61 set(OS_DARWIN TRUE)
62elseif(ANDROID)
63 target_sources(usb PRIVATE
64 libusb/libusb/os/linux_usbfs.c
65 libusb/libusb/os/linux_netlink.c
66 )
67 find_library(LOG_LIBRARY log)
68 target_link_libraries(usb PRIVATE ${LOG_LIBRARY})
69 set(OS_LINUX TRUE)
70elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
71 target_sources(usb PRIVATE
72 libusb/libusb/os/linux_usbfs.c
73 )
74 find_package(Libudev)
75 if(LIBUDEV_FOUND)
76 target_sources(usb PRIVATE
77 libusb/libusb/os/linux_udev.c
78 )
79 target_link_libraries(usb PRIVATE "${LIBUDEV_LIBRARIES}")
80 target_include_directories(usb PRIVATE "${LIBUDEV_INCLUDE_DIR}")
81 set(HAVE_LIBUDEV TRUE)
82 set(USE_UDEV TRUE)
83 else()
84 target_sources(usb PRIVATE
85 libusb/libusb/os/linux_netlink.c
86 )
87 endif()
88 set(OS_LINUX TRUE)
89elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
90 target_sources(usb PRIVATE
91 libusb/libusb/os/netbsd_usb.c
92 )
93 set(OS_NETBSD TRUE)
94elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
95 target_sources(usb PRIVATE
96 libusb/libusb/os/openbsd_usb.c
97 )
98 set(OS_OPENBSD TRUE)
99endif()
100
101if(UNIX)
102 target_sources(usb PRIVATE
103 libusb/libusb/os/poll_posix.c
104 libusb/libusb/os/threads_posix.c
105 )
106 find_package(Threads REQUIRED)
107 if(THREADS_HAVE_PTHREAD_ARG)
108 target_compile_options(usb PUBLIC "-pthread")
109 endif()
110 if(CMAKE_THREAD_LIBS_INIT)
111 target_link_libraries(usb PRIVATE "${CMAKE_THREAD_LIBS_INIT}")
112 endif()
113 set(THREADS_POSIX TRUE)
114elseif(WIN32)
115 target_sources(usb PRIVATE
116 libusb/libusb/os/poll_windows.c
117 libusb/libusb/os/threads_windows.c
118 )
119endif()
120
121include(CheckFunctionExists)
122include(CheckIncludeFiles)
123include(CheckTypeSize)
124check_include_files(asm/types.h HAVE_ASM_TYPES_H)
125check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
126check_include_files(linux/filter.h HAVE_LINUX_FILTER_H)
127check_include_files(linux/netlink.h HAVE_LINUX_NETLINK_H)
128check_include_files(poll.h HAVE_POLL_H)
129check_include_files(signal.h HAVE_SIGNAL_H)
130check_include_files(strings.h HAVE_STRINGS_H)
131check_type_size("struct timespec" STRUCT_TIMESPEC)
132check_function_exists(syslog HAVE_SYSLOG_FUNC)
133check_include_files(syslog.h HAVE_SYSLOG_H)
134check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
135check_include_files(sys/time.h HAVE_SYS_TIME_H)
136check_include_files(sys/types.h HAVE_SYS_TYPES_H)
137
138set(CMAKE_EXTRA_INCLUDE_FILES poll.h)
139check_type_size("nfds_t" nfds_t)
140unset(CMAKE_EXTRA_INCLUDE_FILES)
141if(HAVE_NFDS_T)
142 set(POLL_NFDS_TYPE "nfds_t")
143else()
144 set(POLL_NFDS_TYPE "unsigned int")
145endif()
146
147check_include_files(sys/timerfd.h USBI_TIMERFD_AVAILABLE)
148
149
150configure_file(config.h.in config.h)
diff --git a/externals/libusb/config.h.in b/externals/libusb/config.h.in
new file mode 100644
index 000000000..915b7390f
--- /dev/null
+++ b/externals/libusb/config.h.in
@@ -0,0 +1,90 @@
1/* Default visibility */
2#if defined(__GNUC__) || defined(__clang__)
3 #define DEFAULT_VISIBILITY __attribute__((visibility("default")))
4#elif defined(_MSC_VER)
5 #define DEFAULT_VISIBILITY __declspec(dllexport)
6#endif
7
8/* Start with debug message logging enabled */
9#undef ENABLE_DEBUG_LOGGING
10
11/* Message logging */
12#undef ENABLE_LOGGING
13
14/* Define to 1 if you have the <asm/types.h> header file. */
15#cmakedefine HAVE_ASM_TYPES_H 1
16
17/* Define to 1 if you have the `gettimeofday' function. */
18#cmakedefine HAVE_GETTIMEOFDAY 1
19
20/* Define to 1 if you have the `udev' library (-ludev). */
21#cmakedefine HAVE_LIBUDEV 1
22
23/* Define to 1 if you have the <linux/filter.h> header file. */
24#cmakedefine HAVE_LINUX_FILTER_H 1
25
26/* Define to 1 if you have the <linux/netlink.h> header file. */
27#cmakedefine HAVE_LINUX_NETLINK_H 1
28
29/* Define to 1 if you have the <poll.h> header file. */
30#cmakedefine HAVE_POLL_H 1
31
32/* Define to 1 if you have the <signal.h> header file. */
33#cmakedefine HAVE_SIGNAL_H 1
34
35/* Define to 1 if you have the <strings.h> header file. */
36#cmakedefine HAVE_STRINGS_H 1
37
38/* Define to 1 if the system has the type `struct timespec'. */
39#cmakedefine HAVE_STRUCT_TIMESPEC 1
40
41/* syslog() function available */
42#cmakedefine HAVE_SYSLOG_FUNC 1
43
44/* Define to 1 if you have the <syslog.h> header file. */
45#cmakedefine HAVE_SYSLOG_H 1
46
47/* Define to 1 if you have the <sys/socket.h> header file. */
48#cmakedefine HAVE_SYS_SOCKET_H 1
49
50/* Define to 1 if you have the <sys/time.h> header file. */
51#cmakedefine HAVE_SYS_TIME_H 1
52
53/* Define to 1 if you have the <sys/types.h> header file. */
54#cmakedefine HAVE_SYS_TYPES_H 1
55
56/* Darwin backend */
57#cmakedefine OS_DARWIN 1
58
59/* Linux backend */
60#cmakedefine OS_LINUX 1
61
62/* NetBSD backend */
63#cmakedefine OS_NETBSD 1
64
65/* OpenBSD backend */
66#cmakedefine OS_OPENBSD 1
67
68/* Windows backend */
69#cmakedefine OS_WINDOWS 1
70
71/* type of second poll() argument */
72#define POLL_NFDS_TYPE @POLL_NFDS_TYPE@
73
74/* Use POSIX Threads */
75#cmakedefine THREADS_POSIX
76
77/* timerfd headers available */
78#cmakedefine USBI_TIMERFD_AVAILABLE 1
79
80/* Enable output to system log */
81#define USE_SYSTEM_LOGGING_FACILITY 1
82
83/* Use udev for device enumeration/hotplug */
84#cmakedefine USE_UDEV 1
85
86/* Use GNU extensions */
87#define _GNU_SOURCE
88
89/* Oldest Windows version supported */
90#define WINVER 0x0501
diff --git a/externals/libusb/libusb b/externals/libusb/libusb
new file mode 160000
Subproject e782eeb2514266f6738e242cdcb18e3ae1ed06f
diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h
index 6dae65a66..85d5bd5de 100644
--- a/externals/microprofile/microprofile.h
+++ b/externals/microprofile/microprofile.h
@@ -1037,7 +1037,7 @@ static void MicroProfileCreateThreadLogKey()
1037#else 1037#else
1038MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0; 1038MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0;
1039#endif 1039#endif
1040static bool g_bUseLock = false; /// This is used because windows does not support using mutexes under dll init(which is where global initialization is handled) 1040static std::atomic<bool> g_bUseLock{false}; /// This is used because windows does not support using mutexes under dll init(which is where global initialization is handled)
1041 1041
1042 1042
1043MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee); 1043MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee);
diff --git a/externals/xbyak b/externals/xbyak
Subproject 18c9caaa0a3ed5706c39f5aa86cce0db6e65b17 Subproject c306b8e5786eeeb87b8925a8af5c3bf057ff5a9