From 2bb0818fb407f47700344e2394b3984361a1aea8 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Sun, 21 Aug 2022 03:11:32 +0200 Subject: [PATCH] libobs: Use system header notation for pthread.h include Using a relative path for the pthread.h header by w32-pthreads breaks compilation of plugins which include threading.h from libobs (as w32-pthreads will exist at a different location relative to the libobs header). As w32-pthreads (and its include directory) is added to the libobs target by CMake, the pthread.h header will be found even when using system header notation. Fixes https://github.com/obsproject/obs-studio/issues/7155 --- libobs/CMakeLists.txt | 2 +- libobs/util/threading.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index a7390821d..790583cd5 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -313,7 +313,7 @@ if(OS_WINDOWS) target_link_libraries(libobs PRIVATE Avrt Dwmapi winmm) if(MSVC) - target_link_libraries(libobs PRIVATE OBS::w32-pthreads) + target_link_libraries(libobs PUBLIC OBS::w32-pthreads) target_compile_options(libobs PRIVATE "$<$:/EHc->" "$<$:/EHc->") diff --git a/libobs/util/threading.h b/libobs/util/threading.h index 9807aaf02..f3c987237 100644 --- a/libobs/util/threading.h +++ b/libobs/util/threading.h @@ -26,12 +26,10 @@ #include "c99defs.h" -#ifdef _MSC_VER -#include "../../deps/w32-pthreads/pthread.h" -#else +#ifndef _MSC_VER #include -#include #endif +#include #ifdef __cplusplus extern "C" {