From d7c2bc5f1be69def768c5fd3e163c8021660cdcf Mon Sep 17 00:00:00 2001 From: Hans-Erik Floryd Date: Wed, 30 Apr 2025 14:36:36 +0200 Subject: [PATCH] MinGW support Support building SOEM with MinGW. Change-Id: I7ea59e168ae382b99d7904cffc0719701d44cefc --- cmake/Windows.cmake | 18 +++++++++++++----- oshw/win32/nicdrv.c | 1 - 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cmake/Windows.cmake b/cmake/Windows.cmake index 4b6af6f..7b3482a 100644 --- a/cmake/Windows.cmake +++ b/cmake/Windows.cmake @@ -18,9 +18,17 @@ target_include_directories(soem PUBLIC ) target_compile_options(soem PRIVATE - /D _CRT_SECURE_NO_WARNINGS - /WX -) + $<$: + /D _CRT_SECURE_NO_WARNINGS + /WX + > + $<$: + -Wall + -Wextra + -Werror + -Wno-unused-parameter + > + ) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(WPCAP_LIB_PATH ${SOEM_SOURCE_DIR}/oshw/win32/wpcap/Lib/x64) @@ -31,8 +39,8 @@ endif() target_link_libraries(soem PUBLIC ${WPCAP_LIB_PATH}/wpcap.lib ${WPCAP_LIB_PATH}/Packet.lib - Ws2_32.lib - Winmm.lib + ws2_32.lib + winmm.lib ) install(FILES diff --git a/oshw/win32/nicdrv.c b/oshw/win32/nicdrv.c index c47b704..c71cf91 100644 --- a/oshw/win32/nicdrv.c +++ b/oshw/win32/nicdrv.c @@ -40,7 +40,6 @@ #include #include "ethercattype.h" -#include #include "nicdrv.h" #include "osal_win32.h"