CMakeLists improvements

Only the bergamot-translator library should be linked to main target
Any other library (marian ${MARIAN_CUDA_LIB} ${EXT_LIBS} ssplit
pcrecpp.a pcre.a) should be linked to bergamot-translator target inside
src/translator folder.
This commit is contained in:
Jerin Philip 2021-01-22 11:29:32 +00:00
parent 80125e2789
commit 37143933a1
2 changed files with 3 additions and 7 deletions

View File

@ -1,9 +1,5 @@
add_executable(bergamot-translator-app main.cpp)
target_link_libraries(bergamot-translator-app PRIVATE bergamot-translator)
# Replacement app for marian-decoder from browsermt/mts@nuke
add_executable(main main-mts.cpp)
set_target_properties(main PROPERTIES OUTPUT bergamot-cli RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
target_compile_options(main PUBLIC ${ALL_WARNINGS})
set(EXECUTABLES ${EXECUTABLES} main)
target_link_libraries(main bergamot-translator marian ${MARIAN_CUDA_LIB} ${EXT_LIBS} ssplit pcrecpp.a pcre.a)
add_executable(service-cli main-mts.cpp)
target_link_libraries(service-cli PRIVATE bergamot-translator)

View File

@ -13,7 +13,7 @@ add_library(bergamot-translator STATIC
translation_result.cpp
)
target_link_libraries(bergamot-translator marian)
target_link_libraries(bergamot-translator marian ${MARIAN_CUDA_LIB} ${EXT_LIBS} ssplit pcrecpp.a pcre.a)
target_include_directories(bergamot-translator
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_SOURCE_DIR}