mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 00:14:02 +00:00
cmake: fix building on windows with mingw64
- wpcap/packet libraries were wrong (.a, not .lib; not the x64 ones) - link order resulted in undefined references Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
215dec653b
commit
7807402899
@ -24,8 +24,20 @@ if(NOT DEFINED WPDPACK_DIR)
|
||||
set(WPDPACK_DIR ${LWIP_DIR}/../WpdPack)
|
||||
message(STATUS "WPDPACK_DIR not set - using default location ${WPDPACK_DIR}")
|
||||
endif()
|
||||
find_library(WPCAP wpcap HINTS ${WPDPACK_DIR}/lib)
|
||||
find_library(PACKET packet HINTS ${WPDPACK_DIR}/lib)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(WPDPACK_LIB_DIR ${WPDPACK_DIR}/lib/x64)
|
||||
else()
|
||||
set(WPDPACK_LIB_DIR ${WPDPACK_DIR}/lib)
|
||||
endif()
|
||||
set(WPCAP ${WPDPACK_DIR}/lib/x64/wpcap.lib)
|
||||
set(PACKET ${WPDPACK_DIR}/lib/x64/packet.lib)
|
||||
else()
|
||||
find_library(WPCAP wpcap HINTS ${WPDPACK_DIR}/lib/x64)
|
||||
find_library(PACKET packet HINTS ${WPDPACK_DIR}/lib/x64)
|
||||
endif()
|
||||
message(STATUS "WPCAP library: ${WPCAP}")
|
||||
message(STATUS "PACKET library: ${PACKET}")
|
||||
|
||||
add_library(lwipcontribportwindows EXCLUDE_FROM_ALL ${lwipcontribportwindows_SRCS})
|
||||
target_include_directories(lwipcontribportwindows PRIVATE ${LWIP_INCLUDE_DIRS} "${WPDPACK_DIR}/include" ${LWIP_MBEDTLS_INCLUDE_DIRS})
|
||||
|
@ -15,7 +15,7 @@ add_executable(example_app ${LWIP_DIR}/contrib/examples/example_app/test.c defau
|
||||
target_include_directories(example_app PRIVATE ${LWIP_INCLUDE_DIRS})
|
||||
target_compile_options(example_app PRIVATE ${LWIP_COMPILER_FLAGS})
|
||||
target_compile_definitions(example_app PRIVATE ${LWIP_DEFINITIONS} ${LWIP_MBEDTLS_DEFINITIONS})
|
||||
target_link_libraries(example_app ${LWIP_SANITIZER_LIBS} lwipcontribexamples lwipcontribapps lwipcontribaddons lwipallapps lwipcore lwipcontribportwindows lwipmbedtls)
|
||||
target_link_libraries(example_app ${LWIP_SANITIZER_LIBS} lwipallapps lwipcontribexamples lwipcontribapps lwipcontribaddons lwipcontribportwindows lwipcore lwipmbedtls)
|
||||
|
||||
add_executable(makefsdata ${lwipmakefsdata_SRCS})
|
||||
target_compile_options(makefsdata PRIVATE ${LWIP_COMPILER_FLAGS})
|
||||
|
Loading…
Reference in New Issue
Block a user