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 17LOCAL_PATH := $(call my-dir)/../.. 18 19include $(LOCAL_PATH)/android/jni/include.mk 20LOCAL_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. 24include $(CLEAR_VARS) 25LOCAL_MODULE := flatbuffers 26LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 27LOCAL_EXPORT_CPPFLAGS := -std=c++11 -fexceptions -Wall \ 28 -DFLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE 29 30include $(BUILD_STATIC_LIBRARY) 31 32# static library that additionally includes text parsing/generation/reflection 33# for projects that want richer functionality. 34include $(CLEAR_VARS) 35LOCAL_MODULE := flatbuffers_extra 36LOCAL_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 41LOCAL_STATIC_LIBRARIES := flatbuffers 42include $(BUILD_STATIC_LIBRARY) 43 44# FlatBuffers test 45include $(CLEAR_VARS) 46LOCAL_MODULE := FlatBufferTest 47LOCAL_SRC_FILES := android/jni/main.cpp \ 48 tests/test.cpp \ 49 src/idl_gen_fbs.cpp \ 50 src/idl_gen_general.cpp 51LOCAL_LDLIBS := -llog -landroid 52LOCAL_STATIC_LIBRARIES := android_native_app_glue flatbuffers_extra 53LOCAL_ARM_MODE := arm 54include $(BUILD_SHARED_LIBRARY) 55 56$(call import-module,android/native_app_glue) 57 58$(call import-add-path,$(LOCAL_PATH)/../..) 59