Browse Source

libobs: Fix Windows x86 CMake when using reduced obs-deps package

A recent obs-deps change removed all non-essential x86 deps. This caused
the x86 subproject(s) on Windows to fail to configure due to being
unable to find x86 dependencies that do not exist.

Co-authored-by: PatTheMav <[email protected]>
Ryan Foster 1 năm trước cách đây
mục cha
commit
f0d619521b
2 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 5 0
      libobs/CMakeLists.txt
  2. 4 0
      libobs/cmake/os-windows.cmake

+ 5 - 0
libobs/CMakeLists.txt

@@ -4,6 +4,11 @@ legacy_check()
 
 include(cmake/obs-version.cmake)
 
+if(OS_WINDOWS AND NOT OBS_PARENT_ARCHITECTURE STREQUAL CMAKE_GENERATOR_PLATFORM)
+  include(cmake/os-windows.cmake)
+  return()
+endif()
+
 find_package(Threads REQUIRED)
 
 find_package(FFmpeg 6.1 REQUIRED avformat avutil swscale swresample OPTIONAL_COMPONENTS avcodec)

+ 4 - 0
libobs/cmake/os-windows.cmake

@@ -30,6 +30,10 @@ if(NOT TARGET OBS::w32-pthreads)
   add_subdirectory("${CMAKE_SOURCE_DIR}/deps/w32-pthreads" "${CMAKE_BINARY_DIR}/deps/w32-pthreads")
 endif()
 
+if(NOT OBS_PARENT_ARCHITECTURE STREQUAL CMAKE_GENERATOR_PLATFORM)
+  return()
+endif()
+
 configure_file(cmake/windows/obs-module.rc.in libobs.rc)
 
 target_sources(