浏览代码

UI: Fix building macOS/Sparkle without Browser

derrod 2 年之前
父节点
当前提交
0be8d8a28d
共有 4 个文件被更改,包括 14 次插入14 次删除
  1. 1 0
      UI/CMakeLists.txt
  2. 10 0
      UI/cmake/feature-macos-update.cmake
  3. 2 0
      UI/cmake/feature-sparkle.cmake
  4. 1 14
      UI/cmake/feature-whatsnew.cmake

+ 1 - 0
UI/CMakeLists.txt

@@ -54,6 +54,7 @@ endif()
 include(cmake/feature-twitch.cmake)
 include(cmake/feature-twitch.cmake)
 include(cmake/feature-restream.cmake)
 include(cmake/feature-restream.cmake)
 include(cmake/feature-youtube.cmake)
 include(cmake/feature-youtube.cmake)
+include(cmake/feature-sparkle.cmake)
 include(cmake/feature-whatsnew.cmake)
 include(cmake/feature-whatsnew.cmake)
 
 
 add_subdirectory(frontend-plugins)
 add_subdirectory(frontend-plugins)

+ 10 - 0
UI/cmake/feature-macos-update.cmake

@@ -0,0 +1,10 @@
+include_guard(DIRECTORY)
+
+if(NOT TARGET OBS::blake2)
+  add_subdirectory("${CMAKE_SOURCE_DIR}/deps/blake2" "${CMAKE_BINARY_DIR}/deps/blake2")
+endif()
+
+target_sources(obs-studio PRIVATE update/crypto-helpers.hpp update/crypto-helpers-mac.mm update/shared-update.cpp
+                                  update/shared-update.hpp update/update-helpers.cpp update/update-helpers.hpp)
+
+target_link_libraries(obs-studio PRIVATE "$<LINK_LIBRARY:FRAMEWORK,Security.framework>" OBS::blake2)

+ 2 - 0
UI/cmake/feature-sparkle.cmake

@@ -13,6 +13,8 @@ if(SPARKLE_APPCAST_URL AND SPARKLE_PUBLIC_KEY)
   endif()
   endif()
 
 
   target_enable_feature(obs-studio "Sparkle updater" ENABLE_SPARKLE_UPDATER)
   target_enable_feature(obs-studio "Sparkle updater" ENABLE_SPARKLE_UPDATER)
+
+  include(cmake/feature-macos-update.cmake)
 else()
 else()
   set(SPARKLE_UPDATE_INTERVAL 0) # Set anything that's not an empty integer
   set(SPARKLE_UPDATE_INTERVAL 0) # Set anything that's not an empty integer
   target_disable_feature(obs-studio "Sparkle updater")
   target_disable_feature(obs-studio "Sparkle updater")

+ 1 - 14
UI/cmake/feature-whatsnew.cmake

@@ -1,21 +1,8 @@
 option(ENABLE_WHATSNEW "Enable WhatsNew dialog" ON)
 option(ENABLE_WHATSNEW "Enable WhatsNew dialog" ON)
 
 
-if(NOT TARGET OBS::blake2)
-  add_subdirectory("${CMAKE_SOURCE_DIR}/deps/blake2" "${CMAKE_BINARY_DIR}/deps/blake2")
-endif()
-
 if(ENABLE_WHATSNEW AND TARGET OBS::browser-panels)
 if(ENABLE_WHATSNEW AND TARGET OBS::browser-panels)
   if(OS_MACOS)
   if(OS_MACOS)
-
-    find_library(SECURITY Security)
-    mark_as_advanced(SECURITY)
-
-    target_sources(obs-studio PRIVATE update/crypto-helpers.hpp update/crypto-helpers-mac.mm update/shared-update.cpp
-                                      update/shared-update.hpp update/update-helpers.cpp update/update-helpers.hpp)
-
-    target_link_libraries(obs-studio PRIVATE ${SECURITY} OBS::blake2)
-
-    include(cmake/feature-sparkle.cmake)
+    include(cmake/feature-macos-update.cmake)
   elseif(OS_LINUX)
   elseif(OS_LINUX)
     find_package(MbedTLS REQUIRED)
     find_package(MbedTLS REQUIRED)
     target_link_libraries(obs-studio PRIVATE MbedTLS::MbedTLS OBS::blake2)
     target_link_libraries(obs-studio PRIVATE MbedTLS::MbedTLS OBS::blake2)