Skip to content

Commit

Permalink
Use installed protobuf on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Apr 10, 2024
1 parent f921cb6 commit bf157ab
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions external/cld3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set(cld3_src ${cld3_loc}/src)
set(gen_loc ${cld3_loc}/build/gen)
set(gen_dst ${gen_loc}/cld_3/protos)

if (DESKTOP_APP_USE_PACKAGED)
if (DESKTOP_APP_USE_PACKAGED OR LINUX)
find_package(Protobuf)
if (NOT Protobuf_FOUND)
find_package(protobuf REQUIRED CONFIG)
Expand All @@ -30,9 +30,6 @@ elseif (WIN32)
else()
set(protoc_executable ${libs_loc}/protobuf/build/protoc)
set(protobuf_lib ${libs_loc}/protobuf/build/libprotobuf-lite.a)
if (LINUX)
target_compile_options(external_cld3_bundled PRIVATE -Wno-implicit-fallthrough)
endif()
endif()
if (PROTOBUF_PROTOC_EXECUTABLE)
set(protoc_executable ${PROTOBUF_PROTOC_EXECUTABLE})
Expand Down Expand Up @@ -87,13 +84,18 @@ PRIVATE
script_span/fixunicodevalue.cc
)

target_compile_options_if_exists(external_cld3_bundled
PRIVATE
-Wno-implicit-fallthrough
)

target_include_directories(external_cld3_bundled
PUBLIC
${cld3_src}
${gen_loc}
)

if (NOT DESKTOP_APP_USE_PACKAGED)
if (NOT DESKTOP_APP_USE_PACKAGED AND NOT LINUX)
target_include_directories(external_cld3_bundled
PUBLIC
${libs_loc}/protobuf/src
Expand Down

0 comments on commit bf157ab

Please sign in to comment.