Skip to content

Commit

Permalink
undefine win-specific NOGDI globally and only define inplaces where e…
Browse files Browse the repository at this point in the history
…xplicitly needed
  • Loading branch information
nilsnolde committed Oct 1, 2020
1 parent 720bc50 commit 466f5fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ function(valhalla_module)
PUBLIC
# ERROR macro clashes with windows.h -> NOGDI necessary (e.g. https://github.com/ipkn/crow/issues/87)
# However, NOGDI needs to be undefined in logging.h
$<$<BOOL:${WIN32}>:NOGDI;WIN32_LEAN_AND_MEAN>
$<$<BOOL:${MSVC}>:VC_EXTRALEAN;NOMINMAX;>
$<$<BOOL:${WIN32}>:WIN32_LEAN_AND_MEAN>
$<$<BOOL:${MSVC}>:NOMINMAX>
RAPIDJSON_HAS_STDSTRING
HAS_REMOTE_API=0
AUTO_DOWNLOAD=0
Expand Down Expand Up @@ -192,7 +192,8 @@ create_source_groups("Source Files" ${valhalla_src})

target_compile_definitions(valhalla
PUBLIC
$<$<BOOL:${MSVC}>:VC_EXTRALEAN;WIN32_LEAN_AND_MEAN;NOMINMAX;NOGDI>
$<$<BOOL:${WIN32}>:WIN32_LEAN_AND_MEAN>
$<$<BOOL:${MSVC}>:NOMINMAX>
RAPIDJSON_HAS_STDSTRING # this is a part of the workaround for OBJECT libraries,
# because ${libvalhalla_compile_definitions} must be private.
# To be removed with ${libvalhalla_compile_definitions} below
Expand Down
6 changes: 0 additions & 6 deletions src/baldr/tz_alt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@
// that "If you define NTDDI_VERSION, you must also define _WIN32_WINNT."
// So we declare we require Vista or greater.
# ifdef __MINGW32__
// otherwise LOGFONTW is not defined (defined in shobjidl.h if not NOGDI)
// https://sourceforge.net/p/mingw-w64/bugs/834/
// also needs to be redefined in midgard/loggign.h
# ifdef NOGDI
# undef NOGDI
# endif

# ifndef NTDDI_VERSION
# define NTDDI_VERSION 0x06000000
Expand Down

0 comments on commit 466f5fd

Please sign in to comment.