diff --git a/contributors.txt b/contributors.txt index 20bfeb9a4..6b10e2d58 100644 --- a/contributors.txt +++ b/contributors.txt @@ -182,6 +182,7 @@ YYYY/MM/DD, github id, Full name, email 2017/12/13, enessoylu, Enes Soylu, enessoylutr@gmail.com 2017/12/20, kbsletten, Kyle Sletten, kbsletten@gmail.com 2017/12/27, jkmar, Jakub Marciniszyn, marciniszyn.jk@gmail.com +2018/03/10, uvguy, kangjoni76@gmail.com 2018/01/06, kasbah, Kaspar Emanuel, kaspar@monostable.co.uk 2018/01/15, xgcssch, Sönke Schau, xgcssch@users.noreply.github.com 2018/02/08, razfriman, Raz Friman, raz@razfriman.com @@ -201,4 +202,4 @@ YYYY/MM/DD, github id, Full name, email 2018/07/27, Maksim Novikov, mnovikov.work@gmail.com 2018/07/31 Lucas Henrqiue, lucashenrique580@gmail.com 2018/08/03, ENDOH takanao, djmchl@gmail.com -2018/10/29, chrisaycock, Christopher Aycock, chris[at]chrisaycock[dot]com +2018/10/29, chrisaycock, Christopher Aycock, chris[at]chrisaycock[dot]com \ No newline at end of file diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt index b7ed65b29..28b19a195 100644 --- a/runtime/Cpp/CMakeLists.txt +++ b/runtime/Cpp/CMakeLists.txt @@ -104,6 +104,10 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHE if(NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0)) message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.") endif () +elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND ANDROID) + # Need -Os cflag and cxxflags here to work with exception handling on armeabi. + # see https://github.com/android-ndk/ndk/issues/573 + # and without -stdlib=libc++ cxxflags elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND ( CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") ) diff --git a/runtime/Cpp/README.md b/runtime/Cpp/README.md index f63fa75e4..73fab634f 100644 --- a/runtime/Cpp/README.md +++ b/runtime/Cpp/README.md @@ -25,7 +25,7 @@ The C++ target has been the work of the following people: ## Project Status -* Building on OS X, Windows, and Linux +* Building on OS X, Windows, Android and Linux * No errors and warnings * Library linking * Some unit tests in the OSX project, for important base classes with almost 100% code coverage. @@ -51,6 +51,9 @@ It will automatically use the CMake description to open up a Visual Studio Solut #### Compiling on OSX Either open the included XCode project and build that or use the cmake compilation as described for linux. +#### Compiling on Android +Try run cmake -DCMAKE_ANDROID_NDK=/folder/of/android_ndkr17_and_above -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=14 -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_BUILD_TYPE=Release /folder/antlr4_src_dir -G Ninja. + #### Compiling on Linux - cd /runtime/Cpp (this is where this readme is located) - mkdir build && mkdir run && cd build