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 ()
142
142
143
143
include (${SHARED_DIR} /utils/uncommon/shared_uncommon.cmake )
144
144
145
+ set (THREADS_PREFER_PTHREAD_FLAG ON )
146
+ find_package (Threads REQUIRED )
147
+
145
148
# STATIC LIBRARY
146
149
if (WAMR_BUILD_STATIC )
147
150
add_library (iwasm_static STATIC ${WAMR_RUNTIME_LIB_SOURCE} )
148
151
set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib )
149
152
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} )
151
154
if (WAMR_BUILD_WASM_CACHE EQUAL 1 )
152
155
target_link_libraries (iwasm_static INTERFACE boringssl_crypto )
153
156
endif ()
@@ -160,7 +163,7 @@ if (WAMR_BUILD_SHARED)
160
163
add_library (iwasm_shared SHARED ${WAMR_RUNTIME_LIB_SOURCE} )
161
164
set_target_properties (iwasm_shared PROPERTIES OUTPUT_NAME iwasm )
162
165
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} )
164
167
if (WAMR_BUILD_WASM_CACHE EQUAL 1 )
165
168
target_link_libraries (iwasm_shared INTERFACE boringssl_crypto )
166
169
endif ()
You can’t perform that action at this time.
0 commit comments