From 0be73705d902cb23cc01efc6f01d4492d5b198e2 Mon Sep 17 00:00:00 2001 From: Abhishek Aggarwal Date: Fri, 26 Feb 2021 14:55:30 +0100 Subject: [PATCH] Fixed native builds while using wasm compatible sources - main-mts and marian-decoder-new can't be used because it uses multi-threaded variant of Service class --- CMakeLists.txt | 6 +++--- app/CMakeLists.txt | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45a857f..a84b8e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,9 +67,9 @@ endif(COMPILE_WASM) add_subdirectory(3rd_party) add_subdirectory(src) -if(NOT COMPILE_WASM) - add_subdirectory(app) -endif() + if(COMPILE_WASM) add_subdirectory(wasm) +else() + add_subdirectory(app) endif(COMPILE_WASM) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 24bd0b4..41c5cd0 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,8 +1,10 @@ add_executable(bergamot-translator-app main.cpp) target_link_libraries(bergamot-translator-app PRIVATE bergamot-translator) -add_executable(service-cli main-mts.cpp) -target_link_libraries(service-cli PRIVATE bergamot-translator) +if (NOT USE_WASM_COMPATIBLE_SOURCES) + add_executable(service-cli main-mts.cpp) + target_link_libraries(service-cli PRIVATE bergamot-translator) -add_executable(marian-decoder-new marian-decoder-new.cpp) -target_link_libraries(marian-decoder-new PRIVATE bergamot-translator) + add_executable(marian-decoder-new marian-decoder-new.cpp) + target_link_libraries(marian-decoder-new PRIVATE bergamot-translator) +endif()