cmake: Fix OBS_COMMIT not being set (Windows only)

This commit is contained in:
derrod
2023-10-06 17:21:51 -06:00
committed by Lain
parent e11ffeccb0
commit d78a05e124
+7
View File
@@ -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)