case $host_os in
cygwin*|msys*) curl_cv_cygwin='yes';;
esac
-AM_CONDITIONAL(DOING_CYGWIN, test "x$curl_cv_cygwin" = xyes)
AM_CONDITIONAL([HAVE_WINDRES],
[test "$curl_cv_native_windows" = "yes" && test -n "${RC}"])
list(APPEND libcurl_export ${LIB_SHARED})
add_library(${LIB_SHARED} SHARED ${LIB_SOURCE})
add_library(${PROJECT_NAME}::${LIB_SHARED} ALIAS ${LIB_SHARED})
- if(WIN32 OR CYGWIN)
- if(CYGWIN)
- # For Cygwin always compile dllmain.c as a separate unit since it
- # includes windows.h, which should not be included in other units.
- set_source_files_properties("dllmain.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
- endif()
- set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES "dllmain.c")
- endif()
if(WIN32)
+ set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES "dllmain.c")
set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES "libcurl.rc")
if(CURL_HIDES_PRIVATE_SYMBOLS)
set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES "${PROJECT_SOURCE_DIR}/lib/libcurl.def")
if DOING_NATIVE_WINDOWS
CSOURCES += dllmain.c
-else
-if DOING_CYGWIN
-CSOURCES += dllmain.c
-endif
endif
if USE_UNITY
# applying to it.
curl_EXCLUDE += memdebug.c
endif
-# For Cygwin always compile dllmain.c as a separate unit since it
-# includes windows.h, which should not be included in other units.
-if DOING_CYGWIN
-curl_EXCLUDE += dllmain.c
-endif
libcurl_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CSOURCES)
@PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CSOURCES) --exclude $(curl_EXCLUDE) > libcurl_unity.c
#include <openssl/crypto.h>
#endif
-/* The fourth-to-last include */
-#ifdef __CYGWIN__
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#ifdef _WIN32
-#undef _WIN32
-#endif
-#endif
-
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
-/* DllMain() must only be defined for Windows and Cygwin DLL builds. */
-#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(CURL_STATICLIB)
+/* DllMain() must only be defined for Windows DLL builds. */
+#if defined(_WIN32) && !defined(CURL_STATICLIB)
#if defined(USE_OPENSSL) && \
!defined(OPENSSL_IS_AWSLC) && \