Skip to content

Commit

Permalink
Improve flatbuffer recipe
Browse files Browse the repository at this point in the history
- Bump to the latest version
- Clean up old workarounds from the recipe
  • Loading branch information
ktf committed Jul 3, 2024
1 parent 081879f commit b230e72
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions flatbuffers.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
package: flatbuffers
version: v1.12.0
version: v24.3.25
source: https://github.com/google/flatbuffers
requires:
- zlib
build_requires:
- CMake
- "GCC-Toolchain:(?!osx)"
- alibuild-recipe-tools
- ninja
---
#!/bin/bash -e
cmake "$SOURCEDIR" \
-G 'Unix Makefiles' \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="$INSTALLROOT" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-unknown-warning -Wno-unknown-warning-option -Wno-error=unused-but-set-variable"
# LLVM 15 requires -Wno-error=unused-but-set-variable to compile
# flatbuffers, but GCC earlier LLVM versions don't understand this
# option, so we need -Wno-unknown-warning (for GCC) and
# -Wno-unknown-warning-option (for Clang) as well.
cmake "$SOURCEDIR" \
-G 'Ninja' \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="$INSTALLROOT"

make ${JOBS:+-j $JOBS}
make install
cmake --build . -- ${JOBS:+-j$JOBS} install

# Work around potentially faulty CMake (missing `install` for binaries)
mkdir -p "$INSTALLROOT/bin"
for bin in flathash flatc; do
[ -e "$INSTALLROOT/bin/$bin" ] || cp -p "$bin" "$INSTALLROOT/bin/"
done
#mkdir -p "$INSTALLROOT/bin"
#for bin in flathash flatc; do
# [ -e "$INSTALLROOT/bin/$bin" ] || cp -p "$bin" "$INSTALLROOT/bin/"
#done

# Modulefile
mkdir -p "$INSTALLROOT/etc/modulefiles"
Expand Down

0 comments on commit b230e72

Please sign in to comment.