1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dist/tools: add support for flatc compiler

This commit is contained in:
Alexandre Abadie 2019-11-27 16:26:50 +01:00
parent 53cb3b087c
commit 9de6047097
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
3 changed files with 35 additions and 0 deletions

2
dist/tools/flatc/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
flatc
bin

28
dist/tools/flatc/Makefile vendored Normal file
View File

@ -0,0 +1,28 @@
PKG_NAME=flatc
PKG_URL=https://github.com/google/flatbuffers
PKG_VERSION=9e7e8cbe9f675123dd41b7c62868acad39188cae
PKG_LICENSE=Apache2.0
PKG_BUILDDIR=$(CURDIR)/bin
# manually set some RIOT env vars, so this Makefile can be called stand-alone
RIOTBASE ?= $(CURDIR)/../../..
RIOTTOOLS ?= $(CURDIR)/..
GITCACHE ?= $(RIOTTOOLS)/git/git-cache
CMAKE_OPTIONS = \
-DCMAKE_BUILD_TYPE=Release \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DFLATBUFFERS_BUILD_FLATHASH=OFF \
-DFLATBUFFERS_BUILD_FLATLIB=OFF \
#
include $(RIOTBASE)/pkg/pkg.mk
all:
@cd "$(PKG_BUILDDIR)" && env -i PATH="$(PATH)" cmake -G "Unix Makefiles" $(CMAKE_OPTIONS) .
"$(MAKE)" -C "$(PKG_BUILDDIR)"
@mv "$(PKG_BUILDDIR)"/flatc $(CURDIR)/flatc
distclean::
@rm -f $(CURDIR)/flatc

View File

@ -34,3 +34,8 @@ $(RIOTTOOLS)/setsid/setsid: $(RIOTTOOLS)/setsid/Makefile
@echo "[INFO] setsid binary not found - building it from source now"
@make -C $(RIOTTOOLS)/setsid
@echo "[INFO] setsid binary successfully built!"
$(RIOTTOOLS)/flatc/flatc: $(RIOTTOOLS)/flatc/Makefile
@echo "[INFO] flatc binary not found - building it from source now"
make -C $(RIOTTOOLS)/flatc
@echo "[INFO] flatc binary successfully built!"