Skip to content

Commit

Permalink
Merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
terrabyte25 committed Jun 9, 2019
2 parents e3ca655 + 1b1a18e commit 7eacf52
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 42 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ android {

defaultConfig {
applicationId "is.terrabyte.omw"
versionCode 17
versionCode 19
versionName calculateVersion()

minSdkVersion 21
minSdkVersion 22
targetSdkVersion 27

ndk {
Expand Down
43 changes: 10 additions & 33 deletions buildscripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ set(MYGUI_VERSION 3.2.2)
set(MYGUI_HASH SHA256=0a28d7ec8a47993cb68deb48b36331e28f12dd92580b709eaef21d599b67a78f)

# https://github.com/ptitSeb/gl4es
set(GL4ES_VERSION 5ad06f591db5324dff5736c625184db90cd01b49)
set(GL4ES_HASH SHA256=c308fc4f6f0f3f8ea9b002fceef038f7049b4ad9ad3bcad0aa603146b771eb28)
set(GL4ES_VERSION 152d17667a0d0521361faf0294f41263db6c56f5)
set(GL4ES_HASH SHA256=bed859c21731467e7b6363667778615ebe9accd1c84f8279e0287e33bcd4be08)

# https://github.com/openscenegraph/OpenSceneGraph/releases
set(OSG_VERSION 3.6.2)
set(OSG_HASH SHA256=762c6601f32a761c7a0556766097558f453f23b983dd75bcf90f922e2d077a34)

# https://github.com/OpenMW/openmw/commits/master
set(OPENMW_VERSION c66ddea4294ed2244799f65718b400dfd346395e)
set(OPENMW_HASH SHA256=57007b6fd06479fde3eae98e5f1435ad09a7e39e98a9f5cd4738bc47cb6fac0c)
set(OPENMW_VERSION 2436652181b339f237ef62395c24ad3d0e3b7c8e)
set(OPENMW_HASH SHA256=253856d492ff484dab422e278ff6994f12a583ab88636757fd2ea91be2023e9c)

# https://github.com/tes3mp/openmw-tes3mp/commits/0.7.0
set(TES3MP_VERSION 292536439eeda58becdb7e441fe2e61ebb74529e)
Expand All @@ -66,9 +66,8 @@ set(prefix ${CMAKE_INSTALL_PREFIX})
set(host ${ndk_triplet})
set(android_platform android-${ANDROID_API})
set(app_abi ${ABI})
set(osg_plugins_dir ${prefix}/osg/lib/osgPlugins-${OSG_VERSION})

set(COMMON_CMAKE_ARGS_NO_PREFIX
set(COMMON_CMAKE_ARGS
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/toolchain/ndk/build/cmake/android.toolchain.cmake
-DANDROID_ABI=${app_abi}
-DANDROID_PLATFORM=${android_platform}
Expand All @@ -79,10 +78,6 @@ set(COMMON_CMAKE_ARGS_NO_PREFIX
-DCMAKE_SHARED_LINKER_FLAGS=$ENV{LDFLAGS}
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
-DCMAKE_DEBUG_POSTFIX=
)

set(COMMON_CMAKE_ARGS
${COMMON_CMAKE_ARGS_NO_PREFIX}
-DCMAKE_INSTALL_PREFIX=${prefix}
-DCMAKE_FIND_ROOT_PATH=${prefix}
)
Expand Down Expand Up @@ -402,9 +397,11 @@ set(OSG_COMMON
-DBUILD_OSG_PLUGIN_JPEG=ON
-DBUILD_OSG_PLUGIN_PNG=ON
-DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF
-DANDROID=ON
)

set(OSG_PATCH
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/remove-lib-prefix-from-plugins.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0001-Replace-Atomic-impl-with-std-atomic.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0002-BufferObject-make-numClients-atomic.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0003-Array-make-possible-to-use-thread-safely-with-setTex.patch &&
Expand All @@ -415,15 +412,13 @@ set(OSG_PATCH
ExternalProject_Add(osg
DEPENDS libjpeg-turbo libpng gl4es

URL https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-${OSG_VERSION}.tar.gz
URL_HASH ${OSG_HASH}
DOWNLOAD_DIR ${download_dir}
GIT_REPOSITORY https://github.com/Capostrophic/OpenSceneGraph.git
GIT_TAG 3.6

PATCH_COMMAND ${OSG_PATCH}

CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>
${COMMON_CMAKE_ARGS_NO_PREFIX}
-DCMAKE_INSTALL_PREFIX=${prefix}/osg
${COMMON_CMAKE_ARGS}
${OSG_COMMON}

BUILD_COMMAND ${wrapper_command} $(MAKE)
Expand Down Expand Up @@ -495,15 +490,6 @@ ExternalProject_Add(openmw
CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>
${COMMON_CMAKE_ARGS}
${OPENMW_COMMON}
-DOSG_PLUGINS_DIR=${osg_plugins_dir}
-DOSGDB_BMP_LIBRARY=${osg_plugins_dir}/libosgdb_bmp.a
-DOSGDB_DDS_LIBRARY=${osg_plugins_dir}/libosgdb_dds.a
-DOSGDB_JPEG_LIBRARY=${osg_plugins_dir}/libosgdb_jpeg.a
-DOSGDB_OSG_LIBRARY=${osg_plugins_dir}/libosgdb_osg.a
-DOSGDB_PNG_LIBRARY=${osg_plugins_dir}/libosgdb_png.a
-DOSGDB_TGA_LIBRARY=${osg_plugins_dir}/libosgdb_tga.a
-DOSGDB_SERIALIZERS_OSG_LIBRARY=${osg_plugins_dir}/libosgdb_serializers_osg.a
-DOPENMW_DEPENDENCIES_DIR=${prefix}/osg

BUILD_COMMAND $(MAKE)

Expand All @@ -521,15 +507,6 @@ ExternalProject_Add(tes3mp
CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>
${COMMON_CMAKE_ARGS}
${OPENMW_COMMON}
-DOSG_PLUGINS_DIR=${osg_plugins_dir}
-DOSGDB_BMP_LIBRARY=${osg_plugins_dir}/libosgdb_bmp.a
-DOSGDB_DDS_LIBRARY=${osg_plugins_dir}/libosgdb_dds.a
-DOSGDB_JPEG_LIBRARY=${osg_plugins_dir}/libosgdb_jpeg.a
-DOSGDB_OSG_LIBRARY=${osg_plugins_dir}/libosgdb_osg.a
-DOSGDB_PNG_LIBRARY=${osg_plugins_dir}/libosgdb_png.a
-DOSGDB_TGA_LIBRARY=${osg_plugins_dir}/libosgdb_tga.a
-DOSGDB_SERIALIZERS_OSG_LIBRARY=${osg_plugins_dir}/libosgdb_serializers_osg.a
-DOPENMW_DEPENDENCIES_DIR=${prefix}/osg

BUILD_COMMAND $(MAKE)

Expand Down
15 changes: 15 additions & 0 deletions buildscripts/patches/osg/remove-lib-prefix-from-plugins.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake
index 120f7f602..93f6cb4ec 100644
--- a/CMakeModules/OsgMacroUtils.cmake
+++ b/CMakeModules/OsgMacroUtils.cmake
@@ -286,6 +286,10 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
ENDIF(DYNAMIC_OPENSCENEGRAPH)

+ # XXX: remove the "lib" prefix e.g. "libosgdb_bmp.a" => "osgdb_bmp.a"
+ # for some reason this is only a problem on android
+ SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "")
+
IF(MSVC)
IF(NOT CMAKE24)
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "${OSG_PLUGINS}") # Sets the ouput to be /osgPlugin-X.X.X ; also ensures the /Debug /Release are removed
14 changes: 7 additions & 7 deletions buildscripts/upload-symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ def find_version_code():


def find_app_id():
with open("../app/build.gradle", "r") as fin:
for line in fin.readlines():
line = line.strip()
if line.startswith("applicationId"):
return line.split()[1].replace('"', "")
user_input = ""
while user_input not in ["y", "n"]:
user_input = input("Nightly? (y/n) ")
if user_input == "y":
return "is.xyz.omw_nightly"
return "is.xyz.omw"


def find_api_key():
Expand Down Expand Up @@ -109,8 +110,7 @@ def main():
libraries = []
for abi in os.listdir("symbols"):
for so in os.listdir(os.path.join("symbols", abi)):
if so != "libopenmw.so":
libraries.append((abi, so))
libraries.append((abi, so))

with Pool(16) as p:
p.map(do_symbol_file, libraries)
Expand Down

0 comments on commit 7eacf52

Please sign in to comment.