changeset 2781:13038d638097

primitives for android ndk
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 20 Jul 2018 11:01:33 +0200
parents d4e81e0a8324
children 64e3d4ab158d
files Resources/CMake/BoostConfiguration.cmake Resources/CMake/Compiler.cmake Resources/Patches/boost-1.67.0-linux-standard-base.patch
diffstat 3 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/BoostConfiguration.cmake	Tue Jul 17 17:50:03 2018 +0200
+++ b/Resources/CMake/BoostConfiguration.cmake	Fri Jul 20 11:01:33 2018 +0200
@@ -97,7 +97,8 @@
     ${BOOST_SOURCES_DIR}/libs/system/src/error_code.cpp
     )
 
-  if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
+  if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase" OR
+      "${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
     add_definitions(
       -DBOOST_SYSTEM_USE_STRERROR=1
       )
@@ -148,7 +149,10 @@
       )
 
   elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
-    # No support for threads in WebAssembly
+    # No support for threads in asm.js/WebAssembly
+
+  elseif (CMAKE_SYSTEM_NAME STREQUAL "Android")
+    # No support for threads in Android
 
   else()
     message(FATAL_ERROR "Support your platform here")
@@ -181,7 +185,8 @@
 
   if (CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
       CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
-      CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
+      CMAKE_SYSTEM_NAME STREQUAL "NaCl64" OR
+      CMAKE_SYSTEM_NAME STREQUAL "Android")
     # boost::filesystem is not available on PNaCl
     add_definitions(
       -DBOOST_HAS_FILESYSTEM_V3=0
--- a/Resources/CMake/Compiler.cmake	Tue Jul 17 17:50:03 2018 +0200
+++ b/Resources/CMake/Compiler.cmake	Fri Jul 20 11:01:33 2018 +0200
@@ -180,7 +180,10 @@
   # cannot be properly catched by "try {} catch (...)" constructions.
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]' -s BINARYEN_TRAP_MODE='\"clamp\"'")
 
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Android")
+
 else()
+  message("Unknown target platform: ${CMAKE_SYSTEM_NAME}")
   message(FATAL_ERROR "Support your platform here")
 endif()
 
--- a/Resources/Patches/boost-1.67.0-linux-standard-base.patch	Tue Jul 17 17:50:03 2018 +0200
+++ b/Resources/Patches/boost-1.67.0-linux-standard-base.patch	Fri Jul 20 11:01:33 2018 +0200
@@ -17,7 +17,7 @@
    #define BOOST_THREAD_INTERNAL_CLOCK_IS_MONO
  #elif defined(BOOST_THREAD_CHRONO_MAC_API)
    #define BOOST_THREAD_HAS_MONO_CLOCK
-+#elif defined(__LSB_VERSION__)
++#elif defined(__LSB_VERSION__) || defined(__ANDROID__)
 +  #define BOOST_THREAD_HAS_MONO_CLOCK
  #else
    #include <time.h> // check for CLOCK_MONOTONIC