1
0
Fork 0

Fix packaged build with cld3

This commit is contained in:
Ilya Fedin 2022-11-24 09:44:31 +04:00 committed by John Preston
parent 25088a573b
commit 2c86aa9a3d

View file

@ -7,10 +7,6 @@
add_library(external_cld3 INTERFACE IMPORTED GLOBAL) add_library(external_cld3 INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_cld3 ALIAS external_cld3) add_library(desktop-app::external_cld3 ALIAS external_cld3)
if (DESKTOP_APP_USE_PACKAGED)
# find_package(Protobuf REQUIRED)
endif()
add_library(external_cld3_bundled STATIC) add_library(external_cld3_bundled STATIC)
init_target(external_cld3_bundled "(external)") init_target(external_cld3_bundled "(external)")
@ -20,7 +16,11 @@ set(cld3_src ${cld3_loc}/src)
set(gen_loc ${cld3_loc}/build/gen) set(gen_loc ${cld3_loc}/build/gen)
set(gen_dst ${gen_loc}/cld_3/protos) set(gen_dst ${gen_loc}/cld_3/protos)
if (WIN32) if (DESKTOP_APP_USE_PACKAGED)
find_package(Protobuf REQUIRED)
set(protoc_executable protobuf::protoc)
set(protobuf_lib protobuf::libprotobuf-lite)
elseif (WIN32)
set(build_loc ${libs_loc}/protobuf/build/$<IF:$<CONFIG:Debug>,Debug,Release>) set(build_loc ${libs_loc}/protobuf/build/$<IF:$<CONFIG:Debug>,Debug,Release>)
set(protoc_executable ${build_loc}/protoc.exe) set(protoc_executable ${build_loc}/protoc.exe)
set(protobuf_lib ${build_loc}/libprotobuf-lite.lib) set(protobuf_lib ${build_loc}/libprotobuf-lite.lib)
@ -89,10 +89,16 @@ target_include_directories(external_cld3_bundled
PUBLIC PUBLIC
${cld3_src} ${cld3_src}
${gen_loc} ${gen_loc}
${libs_loc}/protobuf/src
${libs_loc}/protobuf/third_party/abseil-cpp
) )
if (NOT DESKTOP_APP_USE_PACKAGED)
target_include_directories(external_cld3_bundled
PUBLIC
${libs_loc}/protobuf/src
${libs_loc}/protobuf/third_party/abseil-cpp
)
endif()
target_link_libraries(external_cld3 target_link_libraries(external_cld3
INTERFACE INTERFACE
external_cld3_bundled external_cld3_bundled