File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,15 @@ endif ()
142142
143143include (${SHARED_DIR} /utils/uncommon/shared_uncommon.cmake)
144144
145+ set (THREADS_PREFER_PTHREAD_FLAG ON )
146+ find_package (Threads REQUIRED)
147+
145148# STATIC LIBRARY
146149if (WAMR_BUILD_STATIC)
147150 add_library (iwasm_static STATIC ${WAMR_RUNTIME_LIB_SOURCE} )
148151 set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib)
149152 target_include_directories (iwasm_static INTERFACE ${WAMR_ROOT_DIR} /core/iwasm/include )
150- target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread )
153+ target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl ${CMAKE_THREAD_LIBS_INIT} )
151154 if (WAMR_BUILD_WASM_CACHE EQUAL 1)
152155 target_link_libraries (iwasm_static INTERFACE boringssl_crypto)
153156 endif ()
@@ -160,7 +163,7 @@ if (WAMR_BUILD_SHARED)
160163 add_library (iwasm_shared SHARED ${WAMR_RUNTIME_LIB_SOURCE} )
161164 set_target_properties (iwasm_shared PROPERTIES OUTPUT_NAME iwasm)
162165 target_include_directories (iwasm_shared INTERFACE ${WAMR_ROOT_DIR} /core/iwasm/include )
163- target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread )
166+ target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl ${CMAKE_THREAD_LIBS_INIT} )
164167 if (WAMR_BUILD_WASM_CACHE EQUAL 1)
165168 target_link_libraries (iwasm_shared INTERFACE boringssl_crypto)
166169 endif ()
You can’t perform that action at this time.
0 commit comments