1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
From: Kentaro Hayashi <hayashi@clear-code.com>
Date: Sat, 12 Sep 2020 21:47:32 +0900
Subject: Explicitly link libatomic for missing __atomic builtins
Author: Kentaro HAYASHI
Forwarded: no
---
CMakeLists.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72887aa..8a67dc1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,7 +63,10 @@ set_target_properties(fasttext-static PROPERTIES OUTPUT_NAME fasttext)
set_target_properties(fasttext-static_pic PROPERTIES OUTPUT_NAME fasttext_pic
POSITION_INDEPENDENT_CODE True)
add_executable(fasttext-bin src/main.cc)
-target_link_libraries(fasttext-bin pthread fasttext-shared)
+if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
+ target_link_libraries(fasttext-shared atomic)
+endif()
+target_link_libraries(fasttext-bin pthread fasttext-shared atomic)
set_target_properties(fasttext-bin PROPERTIES PUBLIC_HEADER "${HEADER_FILES}" OUTPUT_NAME fasttext)
install (TARGETS fasttext-shared
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|