From 19150f7e7ac6e47e67b82c675f13ef1e550d429d Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 24 Feb 2017 16:20:14 +0100 Subject: Bug#25611609 LINK WITH DYNAMIC RUNTIME LIBRARIES ON WINDOWS Patch for 5.5 and 5.6 Use default runtime libraries on windows, i.e. build with /MD --- cmake/os/Windows.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 1b79970a830..667afc7aabc 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -64,6 +64,7 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4) ENDIF() IF(MSVC) + OPTION(LINK_STATIC_RUNTIME_LIBRARIES "Link with /MT" OFF) # Enable debug info also in Release build, # and create PDB to be able to analyze crashes. FOREACH(type EXE SHARED MODULE) @@ -86,7 +87,9 @@ IF(MSVC) CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT) - STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + IF(LINK_STATIC_RUNTIME_LIBRARIES) + STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + ENDIF() STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}") ENDFOREACH() -- cgit v1.2.1