blob: e29c87289f087af7655194d2395e81e6d47aff38 [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001# 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
42LOCAL_ARM_MODE := arm
43include $(BUILD_STATIC_LIBRARY)
44
45# FlatBuffers test
46include $(CLEAR_VARS)
47LOCAL_MODULE := FlatBufferTest
48LOCAL_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
58LOCAL_LDLIBS := -llog -landroid -latomic
59LOCAL_STATIC_LIBRARIES := android_native_app_glue flatbuffers_extra
60LOCAL_ARM_MODE := arm
61include $(BUILD_SHARED_LIBRARY)
62
63$(call import-module,android/native_app_glue)
64
65$(call import-add-path,$(LOCAL_PATH)/../..)