Skip to content

Commit

Permalink
Use mingw compile definition also to unit tests
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg28019.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
schwabe authored and cron2 committed Jan 16, 2024
1 parent c58c7c3 commit 0ce0689
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 0ce0689

Please sign in to comment.