From: Arne Schwabe Date: Tue, 16 Jan 2024 13:18:31 +0000 (+0100) Subject: Use mingw compile definition also to unit tests X-Git-Tag: v2.7_alpha1~325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ce06893912830fa2044c5d6a62e6333366afd4a;p=thirdparty%2Fopenvpn.git Use mingw compile definition also to unit tests Currently we only apply the defines for windows APIs and Unicode to OpenVPN itself. We should rather treat the unit tests the same as our main binary to reduce potential differences. Change-Id: Ie5aa643ab6190262f7c8b9e614bedb398e85859b Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Message-Id: <20240116131831.31217-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28019.html Signed-off-by: Gert Doering --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bc46c276e..6f370c304 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,6 +290,13 @@ function(add_library_deps target) endif () + if (MINGW) + target_compile_definitions(${target} PRIVATE + -DWIN32_LEAN_AND_MEAN + -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA + ) + endif() + # optional dependencies target_link_libraries(${target} PUBLIC $ @@ -545,11 +552,7 @@ add_executable(openvpn ${SOURCE_FILES}) add_library_deps(openvpn) -if (MINGW) - target_compile_options(openvpn PRIVATE - -DWIN32_LEAN_AND_MEAN - -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA - ) +if(MINGW) target_compile_options(openvpn PRIVATE -municode -UUNICODE) target_link_options(openvpn PRIVATE -municode) endif()