Commit 6ad46cb1 authored by Ryan Pavlik's avatar Ryan Pavlik Committed by Jakob Bornecrantz
Browse files

build: Be able to build against pthreads4w

parent 7e600dd2
......@@ -36,12 +36,21 @@ find_package(Libusb1)
find_package(JPEG)
find_package(realsense2 CONFIG)
find_package(SDL2 CONFIG)
find_package(Threads)
find_package(ZLIB)
find_package(cJSON)
find_package(Systemd)
find_package(OpenGLES COMPONENTS V3)
add_library(xrt-pthreads INTERFACE)
if(WIN32)
find_package(pthreads_windows REQUIRED)
target_link_libraries(xrt-pthreads INTERFACE PThreads4W::PThreads4W_CXXEXC)
else()
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads)
target_link_libraries(xrt-pthreads INTERFACE Threads::Threads)
endif()
if(NOT ANDROID)
# @TODO Turn into a find_package LIBUVC file.
pkg_check_modules(LIBUVC libuvc)
......
......@@ -156,7 +156,7 @@ endif()
# OS library.
add_library(aux_os STATIC ${OS_SOURCE_FILES})
target_link_libraries(aux_os PUBLIC aux-includes PRIVATE Threads::Threads)
target_link_libraries(aux_os PUBLIC aux-includes xrt-pthreads)
if(XRT_HAVE_DBUS)
target_link_libraries(aux_os PRIVATE ${DBUS_LIBRARIES})
target_include_directories(aux_os SYSTEM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment