Răsfoiți Sursa

cmake: Fix OBS_COMMIT not being set (Windows only)

derrod 2 ani în urmă
părinte
comite
d78a05e124
1 a modificat fișierele cu 7 adăugiri și 0 ștergeri
  1. 7 0
      UI/cmake/os-windows.cmake

+ 7 - 0
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)