From bb516f0e91b300e11efbbbb65e71b12e6bfe2790 Mon Sep 17 00:00:00 2001 From: uvguy Date: Sat, 10 Mar 2018 12:53:39 +0700 Subject: [PATCH 1/2] add note android build --- runtime/Cpp/CMakeLists.txt | 4 ++++ runtime/Cpp/README.md | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt index f4940c0c5..fdc18d0f8 100644 --- a/runtime/Cpp/CMakeLists.txt +++ b/runtime/Cpp/CMakeLists.txt @@ -102,6 +102,10 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCH 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} -stdlib=libc++") elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_SYSTEM_NAME MATCHES "Linux") diff --git a/runtime/Cpp/README.md b/runtime/Cpp/README.md index fbcfadd51..8ab89db91 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. @@ -47,6 +47,9 @@ Simply open the VS solution (VS 2013+) and build it. #### 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 From 8f11c738d34ce9e87915fe39b72a82bb3b9f9563 Mon Sep 17 00:00:00 2001 From: Kangjoni76 Date: Tue, 13 Mar 2018 04:27:12 +0700 Subject: [PATCH 2/2] add to contributor list --- contributors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.txt b/contributors.txt index d18168b04..3976d6603 100644 --- a/contributors.txt +++ b/contributors.txt @@ -180,3 +180,4 @@ YYYY/MM/DD, github id, Full name, email 2017/12/03, oranoran, Oran Epelbaum, oran / epelbaum me 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