1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/dist/tools/flatc/Makefile
Alexandre Abadie 86fb4a5685
tools/flatc: don't clone flatbuffers in the global pkg dir
When building with make -j, flatbuffers is cloned by both the flatc build and the regular package build and from time to time a concurrency issue make the build to fail. Keeping regular flatbuffer package and flatc tool sources separate avoid this issue
2020-06-28 11:16:12 +02:00

32 lines
877 B
Makefile

PKG_NAME=flatbuffers
PKG_URL=https://github.com/google/flatbuffers
PKG_VERSION=9e7e8cbe9f675123dd41b7c62868acad39188cae
PKG_LICENSE=Apache2.0
# manually set some RIOT env vars, so this Makefile can be called stand-alone
RIOTBASE ?= $(CURDIR)/../../..
RIOTTOOLS ?= $(CURDIR)/..
PKG_SOURCE_DIR ?= $(CURDIR)/bin
PKG_BUILD_DIR ?= $(CURDIR)/bin/build
CMAKE_OPTIONS = \
-DCMAKE_BUILD_TYPE=Release \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DFLATBUFFERS_BUILD_FLATHASH=OFF \
-DFLATBUFFERS_BUILD_FLATLIB=OFF \
#
ifneq (, $(CCACHE))
CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
endif
include $(RIOTBASE)/pkg/pkg.mk
all:
@env -i PATH="$(PATH)" cmake -G "Unix Makefiles" $(CMAKE_OPTIONS) -H"$(PKG_SOURCE_DIR)" -B"$(PKG_BUILD_DIR)"
"$(MAKE)" -C "$(PKG_BUILD_DIR)"
@mv "$(PKG_BUILD_DIR)"/flatc $(CURDIR)/flatc
distclean::
@rm -f $(CURDIR)/flatc