Skip to content

Commit a9afa94

Browse files
committed
add flatbuffer
1 parent 8054f54 commit a9afa94

File tree

8 files changed

+54
-10
lines changed

8 files changed

+54
-10
lines changed

build/android.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ cfg_armv7_toolchain_bin="${ANDROID_NDK}/toolchains/arm-linux-androideabi-${cfg_d
3030

3131
#build arches and build libraries
3232
cfg_all_supported_arches=("arm" "armv7" "x86" "arm64")
33-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
33+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
3434
cfg_default_arches_all=("arm" "armv7" "x86")
35-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
35+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
3636

3737

3838
#whether build fat library, use lipo -S create

build/ios.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ cfg_armv7s_host_machine="arm-apple-darwin"
1414
cfg_arm64_host_machine="arm-apple-darwin"
1515

1616
cfg_all_supported_arches=("armv7" "armv7s" "i386" "arm64" "x86_64")
17-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
17+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
1818
cfg_default_arches_all=("armv7" "armv7s" "i386" "arm64" "x86_64")
19-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
19+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
2020

2121

2222
cfg_build_fat_library=yes

build/linux.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ cfg_i386_host_machine="i386-linux-gnu"
1717

1818

1919
cfg_all_supported_arches=("i386" "x86_64")
20-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
20+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
2121
cfg_default_arches_all=("x86_64")
22-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
22+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
2323

2424

2525
cfg_build_fat_library=no

build/mac.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ cfg_is_cross_compile=no
2020

2121
#build arches and build libraries
2222
cfg_all_supported_arches=("i386" "x86_64")
23-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
23+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
2424
cfg_default_arches_all=("x86_64")
25-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
25+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
2626

2727

2828
#whether build fat library, use lipo -S create

build/main.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ edtaa3func_header_files=edtaa3func.h
1818
xxhash_header_files=xxhash.h
1919
xxtea_header_files=xxtea.h
2020
convertuft_header_files=ConvertUTF.h
21+
flatbuffer_header_files=flatbuffers
2122

2223

2324
##archive prebuilt name

build/tizen.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ cfg_armv7_toolchain_bin="${TIZEN_SDK}/tools/arm-linux-gnueabi-gcc-4.8/bin"
1919

2020
#build arches and build libraries
2121
cfg_all_supported_arches=("armv7")
22-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
22+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
2323
cfg_default_arches_all=("armv7")
24-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf")
24+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer")
2525

2626

2727
#whether build fat library, use lipo -S create
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index a6f21cb..db39204 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -69,7 +69,7 @@ endif()
6+
7+
include_directories(include)
8+
9+
-add_executable(flatc ${FlatBuffers_Compiler_SRCS})
10+
+add_library(flatbuffer STATIC ${FlatBuffers_Compiler_SRCS})
11+
12+
function(compile_flatbuffers_schema_to_cpp SRC_FBS)
13+
get_filename_component(SRC_FBS_DIR ${SRC_FBS} DIRECTORY)
14+
@@ -93,7 +93,7 @@ endif()
15+
16+
if(FLATBUFFERS_INSTALL)
17+
install(DIRECTORY include/flatbuffers DESTINATION include)
18+
- install(TARGETS flatc DESTINATION bin)
19+
+ install(TARGETS flatbuffer DESTINATION lib)
20+
endif()
21+
22+
if(FLATBUFFERS_BUILD_TESTS)

contrib/src/flatbuffer/rules.mak

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# flatbuffer
2+
3+
FLATBUFFER_GITURL := https://github.com/google/flatbuffers.git
4+
5+
$(TARBALLS)/flatbuffer-git.tar.xz:
6+
$(call download_git,$(FLATBUFFER_GITURL),master,1e4d28b)
7+
8+
9+
.sum-flatbuffer: flatbuffer-git.tar.xz
10+
$(warning $@ not implemented)
11+
touch $@
12+
13+
flatbuffer: flatbuffer-git.tar.xz .sum-flatbuffer
14+
$(UNPACK)
15+
$(APPLY) $(SRC)/flatbuffer/add-library.patch
16+
$(MOVE)
17+
18+
.flatbuffer: flatbuffer toolchain.cmake
19+
cd $< && $(HOSTVARS) ${CMAKE} -DFLATBUFFERS_BUILD_TESTS=OFF
20+
cd $< && $(MAKE) VERBOSE=1 install
21+
touch $@

0 commit comments

Comments
 (0)