Skip to content

Commit

Permalink
cmake: use find_program to locate flatbuffers compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
LnnrtS committed Oct 18, 2023
1 parent b099929 commit fe54b19
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion firmware/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,17 @@ target_include_directories(
)

if (ENABLE_WIFI_BRIDGE)

# Locate flatbuffer compiler
# This falls back to the local flatabuffers repository if not found on PATH
find_program(FLATBUFFERS_FLATC_EXECUTABLE flatc
PATHS ${FWDIR}/lib/flatbuffers/build
REQUIRED)

message("Found flatbuffers compiler at " ${FLATBUFFERS_FLATC_EXECUTABLE})

# Compile flat buffer definitions to cpp headers
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${FWDIR}/lib/flatbuffers/CMake)
set(FLATBUFFERS_FLATC_EXECUTABLE flatc)
include(BuildFlatBuffers)
build_flatbuffers("${CMAKE_CURRENT_LIST_DIR}/wifi/flat/all.fbs" "" flatbuffer_messages_utils "" ${CMAKE_CURRENT_BINARY_DIR}/flat "" "")

Expand Down

0 comments on commit fe54b19

Please sign in to comment.