Skip to content

Commit

Permalink
Windows compilation support (fix missing -lws2_32)
Browse files Browse the repository at this point in the history
Provide `-DWINDOWS=1` to cmake to include necessary dependency ws2_32 in the build process.
  • Loading branch information
zatherz committed Apr 15, 2018
1 parent 88af191 commit e8a80ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ else()
add_library(LIB_LIEF_SHARED SHARED EXCLUDE_FROM_ALL ${LIBLIEF_SOURCE_FILES} ${LIEF_INCLUDE_FILES}) # Shared one
endif()


if(WINDOWS)
target_link_libraries(LIB_LIEF_SHARED ws2_32)
endif()

target_compile_definitions(LIB_LIEF_STATIC PRIVATE -DLIEF_STATIC)
target_compile_definitions(LIB_LIEF_SHARED PRIVATE -DLIEF_EXPORTS)
if (LIEF_SUPPORT_CXX14)
Expand Down

0 comments on commit e8a80ee

Please # to comment.