Skip to content

Commit

Permalink
use libcld2_full.so to detect Hausa
Browse files Browse the repository at this point in the history
related to #24
apparently libcld2.so doesn't detect some languages, including Hausa
  • Loading branch information
zuny26 committed Mar 22, 2021
1 parent 9617a93 commit e2543e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ target_include_directories(warc2text_lib PUBLIC ${PREPROCESS_PATH})
#

# build libcld2.so
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/cld2/internal/libcld2.so")
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/cld2/internal/libcld2_full.so")
execute_process(
COMMAND bash -c "export CFLAGS='-Wno-narrowing -O3' && export CXX='${CMAKE_CXX_COMPILER}' && bash compile_libs.sh"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cld2/internal
)
endif ()
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/cld2/internal/libcld2.so")
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/cld2/internal/libcld2_full.so")
message (FATAL_ERROR "cld2 compilation failed")
endif()
#
Expand All @@ -61,13 +61,13 @@ add_executable(warc2text warc2text_main.cc)
target_link_libraries(warc2text
warc2text_lib
${Boost_LIBRARIES}
${PROJECT_SOURCE_DIR}/cld2/internal/libcld2.so
${PROJECT_SOURCE_DIR}/cld2/internal/libcld2_full.so
)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_custom_command(TARGET warc2text
POST_BUILD COMMAND
${CMAKE_INSTALL_NAME_TOOL} -change libcld2.so ${PROJECT_SOURCE_DIR}/cld2/internal/libcld2.so
${CMAKE_INSTALL_NAME_TOOL} -change libcld2_full.so ${PROJECT_SOURCE_DIR}/cld2/internal/libcld2_full.so
$<TARGET_FILE:warc2text>)
endif()
#

0 comments on commit e2543e4

Please sign in to comment.