Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame^] | 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 | tests/native_type_test_impl.h \ |
| 55 | tests/native_type_test_impl.cpp \ |
| 56 | src/idl_gen_fbs.cpp \ |
| 57 | src/idl_gen_general.cpp |
| 58 | LOCAL_LDLIBS := -llog -landroid -latomic |
| 59 | LOCAL_STATIC_LIBRARIES := android_native_app_glue flatbuffers_extra |
| 60 | LOCAL_ARM_MODE := arm |
| 61 | include $(BUILD_SHARED_LIBRARY) |
| 62 | |
| 63 | $(call import-module,android/native_app_glue) |
| 64 | |
| 65 | $(call import-add-path,$(LOCAL_PATH)/../..) |