Bläddra i källkod

UI: Fix building macOS/Sparkle without Browser

derrod 2 år sedan
förälder
incheckning
0be8d8a28d

+ 1 - 0
UI/CMakeLists.txt

@@ -54,6 +54,7 @@ endif()
 include(cmake/feature-twitch.cmake)
 include(cmake/feature-restream.cmake)
 include(cmake/feature-youtube.cmake)
+include(cmake/feature-sparkle.cmake)
 include(cmake/feature-whatsnew.cmake)
 
 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()
 
   target_enable_feature(obs-studio "Sparkle updater" ENABLE_SPARKLE_UPDATER)
+
+  include(cmake/feature-macos-update.cmake)
 else()
   set(SPARKLE_UPDATE_INTERVAL 0) # Set anything that's not an empty integer
   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)
 
-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(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)
     find_package(MbedTLS REQUIRED)
     target_link_libraries(obs-studio PRIVATE MbedTLS::MbedTLS OBS::blake2)