Bug 170593 - [CMake][Windows] WebKitGUID.lib should be built with the release CRT
Summary: [CMake][Windows] WebKitGUID.lib should be built with the release CRT
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-07 02:51 PDT by Fujii Hironori
Modified: 2017-04-07 09:22 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.62 KB, patch)
2017-04-07 03:03 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.