From 0be8d8a28d7131bcac91089a18e25ec3c9da8e93 Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 27 Apr 2023 09:39:50 +0200 Subject: [PATCH] UI: Fix building macOS/Sparkle without Browser --- UI/CMakeLists.txt | 1 + UI/cmake/feature-macos-update.cmake | 10 ++++++++++ UI/cmake/feature-sparkle.cmake | 2 ++ UI/cmake/feature-whatsnew.cmake | 15 +-------------- 4 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 UI/cmake/feature-macos-update.cmake diff --git a/UI/CMakeLists.txt b/UI/CMakeLists.txt index 3530b19b8..9a671a4bb 100644 --- a/UI/CMakeLists.txt +++ b/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) diff --git a/UI/cmake/feature-macos-update.cmake b/UI/cmake/feature-macos-update.cmake new file mode 100644 index 000000000..2d50a66d9 --- /dev/null +++ b/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 "$" OBS::blake2) diff --git a/UI/cmake/feature-sparkle.cmake b/UI/cmake/feature-sparkle.cmake index 5f96b9560..a89f829f9 100644 --- a/UI/cmake/feature-sparkle.cmake +++ b/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") diff --git a/UI/cmake/feature-whatsnew.cmake b/UI/cmake/feature-whatsnew.cmake index 943e205cb..d87822917 100644 --- a/UI/cmake/feature-whatsnew.cmake +++ b/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)