Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/469?usp=email

to review the following change.


Change subject: Use mingw compile definition also to unit tests
......................................................................

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 <a...@rfc2549.org>
---
M CMakeLists.txt
1 file changed, 14 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/469/1

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 577bc5d..8c24cca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -259,6 +259,15 @@

     endif ()

+    if (MINGW)
+        target_compile_options(${target} PRIVATE
+                -DWIN32_LEAN_AND_MEAN
+                -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA
+        )
+        target_compile_options(${target} PRIVATE -municode -UUNICODE)
+        target_link_options(${target} PRIVATE -municode)
+    endif()
+
     # optional dependencies
     target_link_libraries(${target} PUBLIC
         $<TARGET_NAME_IF_EXISTS:PkgConfig::liblz4>
@@ -514,14 +523,6 @@

 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
-        )
-    target_compile_options(openvpn PRIVATE -municode -UUNICODE)
-    target_link_options(openvpn PRIVATE -municode)
-endif()

 if (MSVC)
     # we have our own manifest
@@ -634,6 +635,11 @@

         target_include_directories(${test_name} PRIVATE src/openvpn)

+        if (MINGW)
+            # when compiling with -municode, mingw looks for wmain instead of 
main
+            target_compile_definitions(${test_name} PRIVATE -Dmain=wmain)
+        endif ()
+
         if (NOT ${test_name} STREQUAL "test_buffer")
             target_sources(${test_name} PRIVATE
                 src/openvpn/buffer.c

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/469?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie5aa643ab6190262f7c8b9e614bedb398e85859b
Gerrit-Change-Number: 469
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-open...@rfc2549.org>
Gerrit-Reviewer: flichtenheld <fr...@lichtenheld.com>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-Attention: flichtenheld <fr...@lichtenheld.com>
Gerrit-MessageType: newchange
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to