Bug 170593

Summary: [CMake][Windows] WebKitGUID.lib should be built with the release CRT
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: WebKit Misc.Assignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, commit-queue, pvollan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Fujii Hironori 2017-04-07 02:51:53 PDT
Source/cmake/OptionsWin.cmake has a following trick to force using /MT.

>  foreach (flag_var
>      CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
>      CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
>      # Use the multithreaded static runtime library instead of the default DLL runtime.
>      string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
>
>      # No debug runtime, even in debug builds.
>      if (NOT DEBUG_SUFFIX)
>          string(REGEX REPLACE "/MTd" "/MT" ${flag_var} "${${flag_var}}")
>          string(REGEX REPLACE "/D_DEBUG" "" ${flag_var} "${${flag_var}}")
>      endif ()
>  endforeach ()

But, this trick affect only to C++, but C.
As the result, WebKitGUID.lib is build with debug CRT because it has C source files.

The below warning messages are reported by this issue.

> LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
Comment 1 Fujii Hironori 2017-04-07 03:03:29 PDT
Created attachment 306482 [details]
Patch
Comment 2 Brent Fulgham 2017-04-07 08:54:16 PDT
Comment on attachment 306482 [details]
Patch

Good catch!
Comment 3 WebKit Commit Bot 2017-04-07 09:22:09 PDT
Comment on attachment 306482 [details]
Patch

Clearing flags on attachment: 306482

Committed r215097: <http://trac.webkit.org/changeset/215097>
Comment 4 WebKit Commit Bot 2017-04-07 09:22:11 PDT
All reviewed patches have been landed.  Closing bug.