From df57e7043734283c0a6a73120b691b4086c70d2f Mon Sep 17 00:00:00 2001 From: lucianoiam Date: Tue, 12 Mar 2024 10:38:07 +0100 Subject: [PATCH] Fix compilation errors on MinGW (#3217) Before PR compilation failed because of two errors: 1 - Usage of CMake target_link_libraries() Make Error at CMakeLists.txt:154 (target_link_libraries): The keyword signature for target_link_libraries has already been used with the target "iwasm_shared". All uses of target_link_libraries with a target must be either all-keyword or all-plain. The uses of the keyword signature are here: * CMakeLists.txt:148 (target_link_libraries) See https://stackoverflow.com/questions/47737558/uses-of-target-link-libraries-must-be-either-all-keyword-or-all-plain Fixed by adding keyword INTERFACE 2 - Undefined symbols during linkage, fixed by adding -lwsock32. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c879949..8df86ddd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,7 +151,7 @@ if (WAMR_BUILD_WASM_CACHE EQUAL 1) endif () if (MINGW) - target_link_libraries (iwasm_shared -lWs2_32) + target_link_libraries (iwasm_shared INTERFACE -lWs2_32 -lwsock32) endif () install (TARGETS iwasm_shared LIBRARY DESTINATION lib)