]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Use mingw compile definition also to unit tests
authorArne Schwabe <arne@rfc2549.org>
Tue, 16 Jan 2024 13:18:31 +0000 (14:18 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 16 Jan 2024 13:21:43 +0000 (14:21 +0100)
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 <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
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 <gert@greenie.muc.de>
CMakeLists.txt

index bc46c276edf9b48842853cc649b78cc55451d928..6f370c3042db2be673e291a897435c4ad5ef7900 100644 (file)
@@ -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
         $<TARGET_NAME_IF_EXISTS:PkgConfig::liblz4>
@@ -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()