From 786928cc875670d748433d04c7742f7a50a14eb0 Mon Sep 17 00:00:00 2001 From: Remy Marquis Date: Sun, 4 Feb 2018 19:02:31 +0100 Subject: [PATCH] libs: adjusted cURL for windows compilation --- curl/lib/CMakeLists.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/curl/lib/CMakeLists.txt b/curl/lib/CMakeLists.txt index 1fabdba9..f6f3274b 100644 --- a/curl/lib/CMakeLists.txt +++ b/curl/lib/CMakeLists.txt @@ -83,6 +83,26 @@ if(WIN32) add_definitions( -D_USRDLL ) endif() +if(MSVC) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHsc /O2") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /EHa /W3") + + set(CompilerFlags + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + ) + + foreach(CompilerFlag ${CompilerFlags}) + string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") + endforeach() + + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT.lib") +endif() + set_target_properties(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL) if(HIDES_CURL_PRIVATE_SYMBOLS)