refactor: introduce internal Launcher_ENABLE_UPDATER variable

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2023-07-27 09:37:56 +02:00
parent 51bfda937d
commit b1aa9e5846
2 changed files with 10 additions and 4 deletions

View File

@ -668,7 +668,7 @@ set(LOGIC_SOURCES
${ATLAUNCHER_SOURCES}
)
if(APPLE AND NOT "${MACOSX_SPARKLE_UPDATE_FEED_URL}" STREQUAL "")
if(APPLE AND Launcher_ENABLE_UPDATER)
set (LOGIC_SOURCES ${LOGIC_SOURCES} ${MAC_UPDATE_SOURCES})
endif()
@ -1141,7 +1141,7 @@ if(APPLE)
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks/")
if(NOT "${MACOSX_SPARKLE_UPDATE_FEED_URL}" STREQUAL "")
if(Launcher_ENABLE_UPDATER)
file(DOWNLOAD ${MACOSX_SPARKLE_DOWNLOAD_URL} ${CMAKE_BINARY_DIR}/Sparkle.tar.xz EXPECTED_HASH SHA256=${MACOSX_SPARKLE_SHA256})
file(ARCHIVE_EXTRACT INPUT ${CMAKE_BINARY_DIR}/Sparkle.tar.xz DESTINATION ${CMAKE_BINARY_DIR}/frameworks/Sparkle)
@ -1155,7 +1155,7 @@ if(APPLE)
"-framework Foundation"
"-framework ApplicationServices"
)
if(NOT "${MACOSX_SPARKLE_UPDATE_FEED_URL}" STREQUAL "")
if(Launcher_ENABLE_UPDATER)
target_link_libraries(Launcher_logic ${SPARKLE_FRAMEWORK})
endif()
endif()
@ -1219,7 +1219,7 @@ if(WIN32)
)
endif()
if (UNIX AND APPLE AND NOT "${MACOSX_SPARKLE_UPDATE_FEED_URL}" STREQUAL "")
if (UNIX AND APPLE AND Launcher_ENABLE_UPDATER)
# Add Sparkle updater
# It has to be copied here instead of just allowing fixup_bundle to install it, otherwise essential parts of
# the framework aren't installed