Skip to content

An OpenMW mod that lets you play the whole Elder Scrolls III: Morrowind as a top-down isometric game — with full online co-op or MMO modes.

C++

Isowind 98a8edb: Version: the git tree hash, so Windows, Linux and Android built from the same source can play together

Isowindc38ca95227df
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4d650f..71c74d8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,7 +85,8 @@ set(OPENMW_VERSION_RELEASE 0)
set(OPENMW_LUA_API_REVISION 129)
set(OPENMW_POSTPROCESSING_API_REVISION 5)
-set(OPENMW_VERSION_COMMITHASH "")
+# Isowind: builds from an exported source tree (no .git, e.g. Android) pass its git tree hash as ISOWIND_SOURCE_HASH
+set(OPENMW_VERSION_COMMITHASH "${ISOWIND_SOURCE_HASH}")
set(OPENMW_VERSION_TAGHASH "")
set(OPENMW_VERSION_COMMITDATE "")
diff --git a/android/buildscripts/CMakeLists.txt b/android/buildscripts/CMakeLists.txt
index 41f2662..e274cba 100644
--- a/android/buildscripts/CMakeLists.txt
+++ b/android/buildscripts/CMakeLists.txt
@@ -632,7 +632,10 @@ ExternalProject_Get_Property(crabnet SOURCE_DIR BINARY_DIR)
set(CRABNET_SOURCE_DIR ${SOURCE_DIR})
set(CRABNET_BINARY_DIR ${BINARY_DIR})
-# Isowind: the engine is this repository (two levels up), exported clean so the build folder isn't copied into itself
+# Isowind: the engine is this repository (two levels up), exported clean so the build folder isn't copied into itself,
+# with its git tree hash as the version (multiplayer only lets the same version play together)
+execute_process(COMMAND git -C ${CMAKE_SOURCE_DIR}/../.. rev-parse HEAD^{tree}
+ OUTPUT_VARIABLE ISOWIND_SOURCE_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
ExternalProject_Add(openmw
DEPENDS boost openal osg mygui ffmpeg sdl2 bullet lz4 luajit libicu crabnet
@@ -644,6 +647,7 @@ ExternalProject_Add(openmw
${COMMON_CMAKE_ARGS}
${OPENMW_COMMON}
-DBUILD_OPENMW_MP=OFF
+ -DISOWIND_SOURCE_HASH=${ISOWIND_SOURCE_HASH}
-DRakNet_INCLUDES=${CRABNET_SOURCE_DIR}/include
-DRakNet_LIBRARY_RELEASE=${CRABNET_BINARY_DIR}/lib/libRakNetLibStatic.a
-DRakNet_LIBRARY_DEBUG=${CRABNET_BINARY_DIR}/lib/libRakNetLibStatic.a
diff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmake
index 44b57b1..87584b0 100644
--- a/cmake/GitVersion.cmake
+++ b/cmake/GitVersion.cmake
@@ -6,8 +6,11 @@ execute_process (
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
+# Isowind: the hash of the source tree rather than of the commit. Multiplayer only lets the same version play
+# together (the hash is part of the connection password), and the tree is the same wherever that source is built:
+# here, and from the snapshot commits pushed to GitHub for the Linux and Android builds.
execute_process (
- COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
+ COMMAND ${GIT_EXECUTABLE} rev-parse HEAD^{tree}
WORKING_DIRECTORY ${OpenMW_SOURCE_DIR}
RESULT_VARIABLE EXITCODE2
OUTPUT_VARIABLE COMMITHASH