Skip to content

Commit

Permalink
Fix compilation errors on MinGW (#3217)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lucianoiam authored Mar 12, 2024
1 parent 0ee5ffc commit df57e70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit df57e70

Please sign in to comment.