Skip to content

Commit

Permalink
build: Pick shared flatbuffers lib first
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisklein committed Jul 16, 2021
1 parent e3d3be8 commit 8859c56
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fairmq/sdk/commands/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CommandsFormatDef.h.in ${CMAKE_CURREN
add_library(${target} Commands.cxx Commands.h ${CMAKE_CURRENT_BINARY_DIR}/CommandsFormat.h ${CMAKE_CURRENT_BINARY_DIR}/CommandsFormatDef.h)
add_library(FairMQ::${target} ALIAS ${target})

# Some distros may not package the static library (e.g. Fedora), so we pick up the dynamic library instead
set(_flatbuffers flatbuffers::flatbuffers)
if(NOT TARGET flatbuffers::flatbuffers AND TARGET flatbuffers::flatbuffers_shared)
set(_flatbuffers flatbuffers::flatbuffers_shared)
set(_flatbuffers flatbuffers::flatbuffers_shared)
if(NOT TARGET flatbuffers::flatbuffers_shared AND TARGET flatbuffers::flatbuffers)
set(_flatbuffers flatbuffers::flatbuffers)
endif()

target_link_libraries(${target}
Expand Down

0 comments on commit 8859c56

Please sign in to comment.