1 # Copyright (c) 2013 Google, Inc. 2 # 3 # This software is provided 'as-is', without any express or implied 4 # warranty. In no event will the authors be held liable for any damages 5 # arising from the use of this software. 6 # Permission is granted to anyone to use this software for any purpose, 7 # including commercial applications, and to alter it and redistribute it 8 # freely, subject to the following restrictions: 9 # 1. The origin of this software must not be misrepresented; you must not 10 # claim that you wrote the original software. If you use this software 11 # in a product, an acknowledgment in the product documentation would be 12 # appreciated but is not required. 13 # 2. Altered source versions must be plainly marked as such, and must not be 14 # misrepresented as being the original software. 15 # 3. This notice may not be removed or altered from any source distribution. 16 17 LOCAL_PATH := $(call my-dir)/../.. 18 19 include $(LOCAL_PATH)/android/jni/include.mk 20 LOCAL_PATH := $(call realpath-portable,$(LOCAL_PATH)) 21 22 # Empty static library so that other projects can include just the basic 23 # FlatBuffers headers as a module. 24 include $(CLEAR_VARS) 25 LOCAL_MODULE := flatbuffers 26 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 27 LOCAL_EXPORT_CPPFLAGS := -std=c++11 -fexceptions -Wall \ 28 -DFLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE 29 30 include $(BUILD_STATIC_LIBRARY) 31 32 # static library that additionally includes text parsing/generation/reflection 33 # for projects that want richer functionality. 34 include $(CLEAR_VARS) 35 LOCAL_MODULE := flatbuffers_extra 36 LOCAL_SRC_FILES := src/idl_parser.cpp \ 37 src/idl_gen_text.cpp \ 38 src/reflection.cpp \ 39 src/util.cpp \ 40 src/code_generators.cpp 41 LOCAL_STATIC_LIBRARIES := flatbuffers 42 LOCAL_ARM_MODE := arm 43 include $(BUILD_STATIC_LIBRARY) 44 45 # FlatBuffers test 46 include $(CLEAR_VARS) 47 LOCAL_MODULE := FlatBufferTest 48 LOCAL_SRC_FILES := android/jni/main.cpp \ 49 tests/test.cpp \ 50 tests/test_assert.h \ 51 tests/test_builder.h \ 52 tests/test_assert.cpp \ 53 tests/test_builder.cpp \ 54 src/idl_gen_fbs.cpp \ 55 src/idl_gen_general.cpp 56 LOCAL_LDLIBS := -llog -landroid -latomic 57 LOCAL_STATIC_LIBRARIES := android_native_app_glue flatbuffers_extra 58 LOCAL_ARM_MODE := arm 59 include $(BUILD_SHARED_LIBRARY) 60 61 $(call import-module,android/native_app_glue) 62 63 $(call import-add-path,$(LOCAL_PATH)/../..) 64