From: Ivan Maidanski Date: Fri, 5 Jul 2019 20:30:37 +0000 (+0300) Subject: Remove dependency on user32.dll import library from static libgc (Win32) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93e07a3c2868aa1a76167303ebbe0bc6fc2cb1a5;p=gc Remove dependency on user32.dll import library from static libgc (Win32) * CMakeLists.txt [!BUILD_SHARED_LIBS && WIN32] (DONT_USE_USER32_DLL): Define C macro; add comment. * configure.ac [($enable_static=yes || $enable_shared=no) && $host=*-*-cygwin*|*-*-mingw*|*-*-msys*] (DONT_USE_USER32_DLL): Likewise. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index fe969f7e..56a91e29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,6 +253,10 @@ if (BUILD_SHARED_LIBS) add_definitions("-DGC_DLL") else() add_definitions("-DGC_NOT_DLL") + if (WIN32) + # Do not require the clients to link with "user32" system library. + add_definitions("-DDONT_USE_USER32_DLL") + endif(WIN32) endif() add_library(gc ${SRC}) diff --git a/configure.ac b/configure.ac index 86fa00b9..08a4dbc2 100644 --- a/configure.ac +++ b/configure.ac @@ -551,6 +551,16 @@ if test "${enable_shared}" = yes; then fi fi +# Do not require the clients to link with "user32" system library. +if test "${enable_static}" = yes -o "${enable_shared}" = no; then + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-msys*) + AC_DEFINE([DONT_USE_USER32_DLL], 1, + [Do not use user32.dll import library (Win32).]) + ;; + esac +fi + # Configuration of machine-dependent code # AC_MSG_CHECKING(which machine-dependent code should be used)