aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/flatbuffers
diff options
context:
space:
mode:
authorGarrett Brown <themagnificentmrb@gmail.com>2018-06-26 14:20:28 -0700
committerGarrett Brown <themagnificentmrb@gmail.com>2018-08-14 11:29:14 -0700
commitcd50c4f4219773548d839a94feaf57d8c6dff3b9 (patch)
tree10a29d46229451f02c669b902c09784ead78ae11 /tools/depends/target/flatbuffers
parent4abbd40cdf9e84dab4795bbca1abc56284c1413f (diff)
tools/depends: Add FlatBuffers v1.9.0 compiler and headers
This adds the flatc compiler to native depends and the flatbuffer headers to target depends.
Diffstat (limited to 'tools/depends/target/flatbuffers')
-rw-r--r--tools/depends/target/flatbuffers/Makefile64
1 files changed, 64 insertions, 0 deletions
diff --git a/tools/depends/target/flatbuffers/Makefile b/tools/depends/target/flatbuffers/Makefile
new file mode 100644
index 0000000000..106a423d01
--- /dev/null
+++ b/tools/depends/target/flatbuffers/Makefile
@@ -0,0 +1,64 @@
+-include ../../Makefile.include
+DEPS=Makefile
+
+# lib name, version
+LIBNAME=flatbuffers
+VERSION=1.9.0
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+ifeq ($(PLATFORM),)
+ # Building stand-alone
+ ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+ PLATFORM = native
+ TARBALLS_LOCATION = $(ROOT_DIR)
+ BASE_URL := http://mirrors.kodi.tv/build-deps/sources
+ RETRIEVE_TOOL := curl -Ls --create-dirs -f -O
+ ARCHIVE_TOOL := tar --strip-components=1 -xf
+ CMAKE := cmake
+ CMAKE_OPTIONS := -DCMAKE_INSTALL_PREFIX=$(PREFIX) $(CMAKE_OPTIONS)
+ BUILD_FLATC=ON
+else
+ # Building as part of depends
+ DEPS += ../../Makefile.include
+ BUILD_FLATC=OFF
+endif
+
+CMAKE_OPTIONS := -DCMAKE_BUILD_TYPE=Release \
+ -DFLATBUFFERS_CODE_COVERAGE=OFF \
+ -DFLATBUFFERS_BUILD_TESTS=OFF \
+ -DFLATBUFFERS_INSTALL=ON \
+ -DFLATBUFFERS_BUILD_FLATLIB=OFF \
+ -DFLATBUFFERS_BUILD_FLATC=$(BUILD_FLATC) \
+ -DFLATBUFFERS_BUILD_FLATHASH=OFF \
+ -DFLATBUFFERS_BUILD_GRPCTEST=OFF \
+ -DFLATBUFFERS_BUILD_SHAREDLIB=OFF \
+ $(CMAKE_OPTIONS)
+BUILDDIR = $(PLATFORM)/build-cmake # 'build' conflicts with file BUILD on case-insensitive FS
+
+all: .installed-$(PLATFORM)
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
+ifeq ($(PREFIX),)
+ @echo
+ @echo "ERROR: please set PREFIX to the kodi install path e.g. make PREFIX=/usr/local"
+ @exit 1
+endif
+ rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ mkdir -p $(BUILDDIR)
+ cd $(BUILDDIR); $(CMAKE) $(CMAKE_OPTIONS) ..
+
+.installed-$(PLATFORM): $(PLATFORM)
+ $(MAKE) -C $(BUILDDIR) install
+ touch $@
+
+clean:
+ $(MAKE) -C $(BUILDDIR) clean
+ rm -f .installed-$(PLATFORM)
+
+distclean:
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)