From ce542525fca5cdddf076a89320badc44f803ecc0 Mon Sep 17 00:00:00 2001 From: BtbN Date: Mon, 5 May 2014 19:07:42 +0200 Subject: [PATCH] Fix dependency on win32-pthreads --- deps/CMakeLists.txt | 5 +---- deps/w32-pthreads/CMakeLists.txt | 4 ++++ libobs/CMakeLists.txt | 2 -- plugins/obs-ffmpeg/CMakeLists.txt | 6 ++++++ plugins/obs-outputs/CMakeLists.txt | 1 + test/test-input/CMakeLists.txt | 3 +++ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 860dee2c5..d61f0b9d5 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -1,7 +1,4 @@ -if(WIN32) - add_subdirectory(w32-pthreads) -endif() - +add_subdirectory(w32-pthreads) add_subdirectory(glad) add_subdirectory(jansson) diff --git a/deps/w32-pthreads/CMakeLists.txt b/deps/w32-pthreads/CMakeLists.txt index b73e59e85..497d5abd6 100644 --- a/deps/w32-pthreads/CMakeLists.txt +++ b/deps/w32-pthreads/CMakeLists.txt @@ -1,5 +1,9 @@ project(w32-pthreads) +if(NOT WIN32) + return() +endif() + set(w32-pthreads_SOURCES pthread.c) diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index 6f8b87cfc..df029d50f 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -26,8 +26,6 @@ if(WIN32) set(libobs_PLATFORM_DEPS w32-pthreads winmm.lib) - - add_definitions(-DPTW32_STATIC_LIB) elseif(APPLE) set(libobs_PLATFORM_SOURCES obs-cocoa.c diff --git a/plugins/obs-ffmpeg/CMakeLists.txt b/plugins/obs-ffmpeg/CMakeLists.txt index e4ccf7c11..a507ae0d2 100644 --- a/plugins/obs-ffmpeg/CMakeLists.txt +++ b/plugins/obs-ffmpeg/CMakeLists.txt @@ -1,5 +1,10 @@ project(obs-ffmpeg) +if(WIN32) + set(obs-ffmpeg_PLATFORM_DEPS + w32-pthreads) +endif() + find_package(Libavcodec REQUIRED) include_directories(${Libavcodec_INCLUDE_DIR}) add_definitions(${Libavcodec_DEFINITIONS}) @@ -32,6 +37,7 @@ add_library(obs-ffmpeg MODULE ${obs-ffmpeg_SOURCES}) target_link_libraries(obs-ffmpeg libobs + ${obs-ffmpeg_PLATFORM_DEPS} ${Libavcodec_LIBRARIES} ${Libavutil_LIBRARIES} ${Libswscale_LIBRARIES} diff --git a/plugins/obs-outputs/CMakeLists.txt b/plugins/obs-outputs/CMakeLists.txt index b3954bf1a..f212a26cb 100644 --- a/plugins/obs-outputs/CMakeLists.txt +++ b/plugins/obs-outputs/CMakeLists.txt @@ -2,6 +2,7 @@ project(obs-outputs) if(WIN32) set(obs-outputs_PLATFORM_DEPS + w32-pthreads ws2_32.lib winmm.lib) endif() diff --git a/test/test-input/CMakeLists.txt b/test/test-input/CMakeLists.txt index 2b07e76f4..ee3e60e20 100644 --- a/test/test-input/CMakeLists.txt +++ b/test/test-input/CMakeLists.txt @@ -21,6 +21,9 @@ if(APPLE) set(test-input_PLATFORM_DEPS ${IOSURF} ${COCOA}) +elseif(WIN32) + set(test-input_PLATFORM_DEPS + w32-pthreads) endif() set(test-input_SOURCES