From 8c6d0b51c719e1817e308375d129b17ede3b82fc Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 7 Nov 2016 22:15:07 +0000 Subject: Use CMake's Android generators to crosscompile --- src/main.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 6061602d7..83056bf61 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,20 @@ #include #include +#ifdef ANDROID + // Workaround for Android NDK builds that do not support std::to_string + namespace std + { + template + std::string to_string(T Value) + { + std::ostringstream TempStream; + TempStream << Value; + return TempStream.str(); + } + } +#endif + #ifdef _MSC_VER #include #endif // _MSC_VER @@ -223,14 +237,11 @@ static void UniversalMain(std::unique_ptr a_Overri // Initialize LibEvent: cNetworkSingleton::Get().Initialise(); - #if !defined(ANDROID_NDK) try - #endif { cRoot Root; Root.Start(std::move(a_OverridesRepo)); } - #if !defined(ANDROID_NDK) catch (std::exception & e) { LOGERROR("Standard exception: %s", e.what()); @@ -239,7 +250,6 @@ static void UniversalMain(std::unique_ptr a_Overri { LOGERROR("Unknown exception!"); } - #endif // Shutdown all of LibEvent: cNetworkSingleton::Get().Terminate(); -- cgit v1.2.3