This repository provides ready-to-use binary builds of FlatCC, the FlatBuffers implementation in C for C.
Check GitHub image versions here: https://github.com/actions/runner-images?tab=readme-ov-file#available-images
The Linux build uses GitHub's ubuntu-latest image. Since FlatCC doesn't have third-party dependencies (other than libc), the build should work for most Linux distributions.
The macOS build uses GitHub's macos-latest image, and provides Universal 2 binaries (executable and libraries).
The Windows build uses GitHub's windows-latest image, and is compiled using MinGW64 (UCRT). If your project uses MSVC instead, please verify the libraries work before using them.
Add this snippet to your CMakeLists.txt, or include it as separate CMake script (e.g. cmake/download_flatcc.cmake).
# Set the version and base URL for FlatCC binaries
set(FLATCC_VERSION "v0.6.2a1")
set(FLATCC_BASE_URL "https://github.com/fseconomy/flatcc-dist/releases/download/${FLATCC_VERSION}")
# Detect the platform
if(WIN32)
set(FLATCC_PLATFORM flatcc-windows.zip)
elseif(APPLE)
set(FLATCC_PLATFORM flatcc-macos.zip)
else()
set(FLATCC_PLATFORM flatcc-linux.zip)
endif()
# Set the download URL
set(FLATCC_URL ${FLATCC_BASE_URL}/${FLATCC_PLATFORM})
# Download and extract FlatCC
include(FetchContent)
FetchContent_Declare(
flatcc
URL ${FLATCC_URL}
)
FetchContent_MakeAvailable(flatcc)The binaries are built from FlatCC's master branch. v0.6.2 isn't released yet, but the rather
low commit frequency suggests that FlatCC is quite mature. Therefore we use v0.6.2 as general release
identifier, suffixed with a pre-release marker. Available releases and the commit they're based on:
- v0.6.2a1 be12a1f
FlatCC is published under the Apache License Version 2.0, cf. LICENSE for details. The source code is available at https://github.com/dvidelabs/flatcc.