-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LightMetal - Add Flatbuffers into cmake infra/build as cpm package (#…
…17039) - Mostly unused here, used by light metal capture/replay coming in follow up PR - Add CMAKE_POSITION_INDEPENDENT_CODE=ON globally (-fPIC) following discussion (needed for flatbuffer to avoid linking errors when lifting to tt-mlir project. - Use -Wno-restrict for flatbuffers compile to supress warning in g++12 build, though don't know why they were fine previously with flatbuffers from UMD - Misc PR feedback about PUBLIC vs PRIVATE, etc.
- Loading branch information
1 parent
61b7cd9
commit 0a91e75
Showing
5 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Function to generate FlatBuffers C++ headers from schema files | ||
function(GENERATE_FBS_HEADER FBS_FILE) | ||
get_filename_component(FBS_FILE_NAME ${FBS_FILE} NAME_WE) | ||
set(FBS_GENERATED_HEADER_DIR "${CMAKE_CURRENT_BINARY_DIR}/flatbuffers") | ||
set(FBS_GENERATED_HEADER_FILE "${FBS_GENERATED_HEADER_DIR}/${FBS_FILE_NAME}_generated.h") | ||
add_custom_command( | ||
OUTPUT | ||
${FBS_GENERATED_HEADER_FILE} | ||
COMMAND | ||
flatc --cpp --scoped-enums -I ${CMAKE_CURRENT_SOURCE_DIR} -o "${FBS_GENERATED_HEADER_DIR}" ${FBS_FILE} | ||
DEPENDS | ||
flatc | ||
${FBS_FILE} | ||
COMMENT "Building C++ header for ${FBS_FILE}" | ||
) | ||
set(FBS_GENERATED_HEADER_FILE ${FBS_GENERATED_HEADER_FILE} PARENT_SCOPE) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters