Skip to content

Commit

Permalink
ndk r26
Browse files Browse the repository at this point in the history
  • Loading branch information
Sisah2 committed Dec 30, 2023
1 parent 219598d commit 9bab5b0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
28 changes: 17 additions & 11 deletions buildscripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ set(BULLET_VERSION 3.17)
set(BULLET_HASH SHA256=baa642c906576d4d98d041d0acb80d85dd6eff6e3c16a009b1abf1ccd2bc0a61)

# https://github.com/MyGUI/mygui/releases
set(MYGUI_VERSION 3.4.1)
set(MYGUI_VERSION 3.4.3)
set(MYGUI_HASH SHA256=d1d5f294670ae71f7200ed4b30859018281d8cfd45d6a38d18b97a4aba604c42)

# https://github.com/sisah2/gl4es/releases
set(GL4ES_VERSION f051976b79cbbf7180e0e999d8b748a18dc0c009)
set(GL4ES_VERSION 5ac069d82ad8ca2cc3c574484e4c5bad880db83e)
set(GL4ES_HASH SHA256=b565e717c7d192e936bda25f3cb90ad8db398af56414ec08294b6716574c1a6d)

# https://github.com/openscenegraph/OpenSceneGraph/releases
Expand All @@ -56,7 +56,7 @@ set(LIBICU_VERSION 70-1)
set(LIBICU_HASH SHA256=4013d7aff8a34bae410664bdb16554d7eda03654b22627b9284ab55a685492d4)

# https://github.com/OpenMW/openmw/commits/master
set(OPENMW_VERSION e8da8aba74cbdeb6159412fd4c19d3f797b494dc)
set(OPENMW_VERSION 4487113d402981984af03ef96e83153620b69696)
set(OPENMW_HASH SHA256=44d044ad0a5546216fe611fe92c37065bb07e2efeeeaac4f049dae03df313186)

# End of configurable options
Expand Down Expand Up @@ -218,11 +218,10 @@ ExternalProject_Add(openal
INSTALL_COMMAND ${wrapper_command} $(MAKE) install
)

string(REPLACE "." "_" BOOST_VERSION_UNDERSCORE ${BOOST_VERSION})
ExternalProject_Add(boost
URL https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.bz2
https://github.com/xyzz/openmw-deps/releases/download/v0/boost_${BOOST_VERSION_UNDERSCORE}.tar.bz2
URL_HASH ${BOOST_HASH}
https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2
#URL_HASH ${BOOST_HASH}
DOWNLOAD_DIR ${download_dir}

BUILD_IN_SOURCE 1
Expand All @@ -240,7 +239,7 @@ ExternalProject_Add(boost
--with-iostreams
--with-regex
--ignore-site-config
toolset=clang-android
toolset=clang
architecture=${BOOST_ARCH}
address-model=${BOOST_ADDRESS_MODEL}
cflags=$ENV{CFLAGS}
Expand All @@ -256,6 +255,7 @@ ExternalProject_Add(boost
COMMAND llvm-ranlib ${prefix}/lib/libboost_program_options.a
COMMAND llvm-ranlib ${prefix}/lib/libboost_system.a
COMMAND llvm-ranlib ${prefix}/lib/libboost_iostreams.a
COMMAND llvm-ranlib ${prefix}/lib/libboost_regex.a
)

ExternalProject_Add(ffmpeg
Expand Down Expand Up @@ -374,10 +374,12 @@ ExternalProject_Add(mygui

CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>
${COMMON_CMAKE_ARGS}
-DMYGUI_RENDERSYSTEM=4
-DMYGUI_RENDERSYSTEM=1
-DMYGUI_BUILD_DEMOS=OFF
-DMYGUI_BUILD_TOOLS=OFF
-DMYGUI_BUILD_PLUGINS=OFF
-DMYGUI_BUILD_TOOLS=OFF
-DMYGUI_DONT_USE_OBSOLETE=ON
-DFREETYPE_FT2BUILD_INCLUDE_DIR=${prefix}/include/freetype2/

-DMYGUI_STATIC=ON
Expand Down Expand Up @@ -486,7 +488,8 @@ ExternalProject_Add(libcollada
-DBoost_INCLUDE_DIR=${prefix}/include
-DHAVE_STRTOQ=0
-DUSE_FILE32API=1

-DCMAKE_CXX_FLAGS=-std=gnu++11\ -I${prefix}/include/\ $ENV{CXXFLAGS}

BUILD_COMMAND ${wrapper_command} $(MAKE)

INSTALL_COMMAND ${wrapper_command} $(MAKE) install
Expand Down Expand Up @@ -524,6 +527,9 @@ set(OSG_COMMON
-DBUILD_OSG_APPLICATIONS=OFF
-DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF
-DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF
#-DOPENGL_opengl_LIBRARY=${prefix}/lib/libGL.so
#-DOPENGL_glx_LIBRARY=${prefix}/lib/libGL.so
#-DOPENGL_INCLUDE_DIR=${prefix}/include/gl4es/
)

set(OSG_PATCH
Expand Down Expand Up @@ -552,6 +558,7 @@ ExternalProject_Add(osg
CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>
${COMMON_CMAKE_ARGS}
${OSG_COMMON}
-DCMAKE_CXX_FLAGS=-std=gnu++11\ -I${prefix}/include/\ $ENV{CXXFLAGS}

BUILD_COMMAND ${wrapper_command} $(MAKE)

Expand Down Expand Up @@ -590,7 +597,7 @@ set(OPENMW_COMMON
set(OPENMW_PATCH
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/openmw/0001-loadingscreen-disable-for-now.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/openmw/0009-windowmanagerimp-always-show-mouse-when-possible-pat.patch &&
#patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/openmw/0010-android-fix-context-being-lost-on-app-minimize.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/openmw/0010-android-fix-context-being-lost-on-app-minimize.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/openmw/fix-build.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/openmw/psa.patch &&
cp ${CMAKE_SOURCE_DIR}/patches/openmw/android_main.cpp <SOURCE_DIR>/apps/openmw/android_main.cpp
Expand All @@ -608,7 +615,6 @@ ExternalProject_Add(openmw
CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>
${COMMON_CMAKE_ARGS}
${OPENMW_COMMON}

BUILD_COMMAND $(MAKE)

INSTALL_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LTO="false"
BUILD_TYPE="release"
CFLAGS="-fPIC"
CXXFLAGS="-fPIC -frtti -fexceptions"
LDFLAGS=""
LDFLAGS="-Wl,--undefined-version"

usage() {
echo "Usage: ./build.sh [--help] [--asan] [--arch arch] [--debug|--release]"
Expand Down
7 changes: 0 additions & 7 deletions buildscripts/include/download-ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,4 @@ fi

curl --http1.1 "https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux.zip" > $NDK_FILE

echo "==> Checking NDK zip file integrity"
FILE_HASH=$(sha256sum $NDK_FILE | awk '{print $1}' )
if [[ $FILE_HASH != $NDK_HASH ]]; then
echo "Failed, expected $NDK_HASH got $FILE_HASH"
exit 1
fi

popd
2 changes: 1 addition & 1 deletion buildscripts/include/version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

NDK_VERSION="r24"
NDK_VERSION="r26b"
NDK_HASH="caac638f060347c9aae994e718ba00bb18413498d8e0ad4e12e1482964032997"

#NDK_VERSION="r25c"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp
index 0de3f5e29..0d766d14d 100644
index 92483bd8c3..77fc0c6698 100644
--- a/apps/openmw/engine.cpp
+++ b/apps/openmw/engine.cpp
@@ -545,6 +545,9 @@ void OMW::Engine::setSkipMenu (bool skipMenu, bool newGame)
@@ -457,6 +457,9 @@ void OMW::Engine::setSkipMenu(bool skipMenu, bool newGame)
mNewGame = newGame;
}

Expand All @@ -11,53 +11,54 @@ index 0de3f5e29..0d766d14d 100644
+
void OMW::Engine::createWindow()
{
int screen = Settings::Manager::getInt("screen", "Video");
@@ -681,6 +684,9 @@ void OMW::Engine::createWindow()
mViewer->realize();
const int screen = Settings::video().mScreen;
@@ -661,6 +664,9 @@ void OMW::Engine::createWindow()

mViewer->getEventQueue()->getCurrentEventState()->setWindowRectangle(0, 0, graphicsWindow->getTraits()->width, graphicsWindow->getTraits()->height);
mViewer->getEventQueue()->getCurrentEventState()->setWindowRectangle(
0, 0, graphicsWindow->getTraits()->width, graphicsWindow->getTraits()->height);
+
+ // To share the viewer with Android interfaces
+ g_viewer = mViewer;
}

void OMW::Engine::setWindowIcon()
@@ -1109,6 +1115,8 @@ void OMW::Engine::go()
@@ -1040,6 +1046,8 @@ void OMW::Engine::go()

luaWorker.join();
mLuaWorker->join();

+ g_viewer.release();
+
// Save user settings
Settings::Manager::saveUser((mCfgMgr.getUserConfigPath() / "settings.cfg").string());
Settings::Manager::saveUser(mCfgMgr.getUserConfigPath() / "settings.cfg");
Settings::ShaderManager::get().save();
diff --git a/components/debug/debugging.cpp b/components/debug/debugging.cpp
index c46971d65..b34bc7a3c 100644
index 3be977657a..6c3dd611bf 100644
--- a/components/debug/debugging.cpp
+++ b/components/debug/debugging.cpp
@@ -13,6 +13,8 @@
#include <components/windows.hpp>
#endif
@@ -34,6 +34,8 @@

#include <SDL_messagebox.h>

+#include <osgViewer/Viewer>
+
namespace Debug
{
#ifdef _WIN32
@@ -188,6 +190,8 @@ void setupLogging(const std::string& logDir, const std::string& appName, std::io
@@ -323,6 +325,8 @@ void setupLogging(const std::filesystem::path& logDir, std::string_view appName,
#endif
}

+extern osg::ref_ptr<osgViewer::Viewer> g_viewer;
+
int wrapApplication(int (*innerApplication)(int argc, char *argv[]), int argc, char *argv[],
const std::string& appName, bool autoSetupLogging)
int wrapApplication(int (*innerApplication)(int argc, char* argv[]), int argc, char* argv[], std::string_view appName)
{
@@ -227,6 +231,7 @@ int wrapApplication(int (*innerApplication)(int argc, char *argv[]), int argc, c
#if defined _WIN32
@@ -362,6 +366,8 @@ int wrapApplication(int (*innerApplication)(int argc, char* argv[]), int argc, c
}
catch (const std::exception& e)
{
+ g_viewer.release();
+
#if (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix))
if (!isatty(fileno(stdin)))
#endif

0 comments on commit 9bab5b0

Please sign in to comment.