From 1250f67771353fb7d21b13d2fd4b53ef8bc3d818 Mon Sep 17 00:00:00 2001 From: nordsoft Date: Fri, 23 Dec 2022 16:33:35 +0400 Subject: [PATCH 1/3] Fix android build --- server/CVCMIServer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index 63bd636af..f31271a16 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -1124,8 +1124,7 @@ void CVCMIServer::create(const std::vector & args) std::vector argv = {foo}; for(auto & a : args) argv.push_back(a.c_str()); - - main(argv.size(), const_cast(foo)); + main(argv.size(), reinterpret_cast(const_cast(&*argv.begin()))); } #elif defined(SINGLE_PROCESS_APP) void CVCMIServer::create(boost::condition_variable * cond, const std::vector & args) From 339846a3078e163772ccdd3463959d5a56a6be91 Mon Sep 17 00:00:00 2001 From: nordsoft Date: Fri, 23 Dec 2022 16:40:52 +0400 Subject: [PATCH 2/3] Add build from beta branch for android --- .github/workflows/github.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index 026e7b67e..010179540 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -244,7 +244,7 @@ jobs: - name: Trigger Android uses: peter-evans/repository-dispatch@v1 - if: ${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && matrix.platform == 'mxe' }} + if: ${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master') && matrix.platform == 'mxe' }} with: token: ${{ secrets.VCMI_ANDROID_ACCESS_TOKEN }} repository: vcmi/vcmi-android From 2953b8fe9d68b4e96ae2450cb39907568be49c17 Mon Sep 17 00:00:00 2001 From: nordsoft Date: Fri, 23 Dec 2022 19:09:28 +0400 Subject: [PATCH 3/3] Fix android build --- server/CVCMIServer.cpp | 4 +--- server/CVCMIServer.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index f31271a16..b00935eb9 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -1118,12 +1118,10 @@ int main(int argc, char * argv[]) } #ifdef VCMI_ANDROID -void CVCMIServer::create(const std::vector & args) +void CVCMIServer::create() { const char * foo = "android-server"; std::vector argv = {foo}; - for(auto & a : args) - argv.push_back(a.c_str()); main(argv.size(), reinterpret_cast(const_cast(&*argv.begin()))); } #elif defined(SINGLE_PROCESS_APP) diff --git a/server/CVCMIServer.h b/server/CVCMIServer.h index 315d803de..fa84e044c 100644 --- a/server/CVCMIServer.h +++ b/server/CVCMIServer.h @@ -114,7 +114,7 @@ public: ui8 getIdOfFirstUnallocatedPlayer() const; #ifdef VCMI_ANDROID - static void create(const std::vector & args); + static void create(); #elif defined(SINGLE_PROCESS_APP) static void create(boost::condition_variable * cond, const std::vector & args); #endif