From d78a05e1246e75e4437c25e1274e4ffe9141df99 Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 3 Oct 2023 03:54:42 +0200 Subject: [PATCH] cmake: Fix OBS_COMMIT not being set (Windows only) --- UI/cmake/os-windows.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UI/cmake/os-windows.cmake b/UI/cmake/os-windows.cmake index 645787f5f..c5cece943 100644 --- a/UI/cmake/os-windows.cmake +++ b/UI/cmake/os-windows.cmake @@ -42,6 +42,13 @@ add_library(OBS::update-helpers ALIAS obs-update-helpers) target_sources(obs-update-helpers INTERFACE win-update/win-update-helpers.cpp win-update/win-update-helpers.hpp) target_include_directories(obs-update-helpers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/win-update") + +# Set commit for untagged version comparisons in the Windows updater +if(OBS_VERSION MATCHES ".+g[a-f0-9]+.*") + string(REGEX REPLACE ".+g([a-f0-9]+).*$" "\\1" OBS_COMMIT ${OBS_VERSION}) +else() + set(OBS_COMMIT "") +endif() set_source_files_properties(update/win-update.cpp PROPERTIES COMPILE_DEFINITIONS OBS_COMMIT="${OBS_COMMIT}") add_subdirectory(win-update/updater)