diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-05 10:10:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-05 10:10:40 +0200 |
commit | 9598fc947ee3482d64f86ef36dd5eefda237344c (patch) | |
tree | 680d24d48149018bd369a980c510a3dc0342ac79 /libbuild2/cc/link-rule.cxx | |
parent | a633d3b662bcc62a304b7d9b2e96a56e77e39b71 (diff) |
Default to MSVC DLL runtime for Clang on Windows
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r-- | libbuild2/cc/link-rule.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index fb7588b..5341a2e 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -2471,13 +2471,15 @@ namespace build2 if (ctype == compiler_type::clang) { - // According to Clang's MSVC.cpp, we shall link libcmt.lib (static - // multi-threaded runtime) unless -nostdlib or -nostartfiles is - // specified. + // See the runtime selection code in the compile rule for details + // on what's going on here. // if (!find_options ({"-nostdlib", "-nostartfiles"}, t, c_coptions) && !find_options ({"-nostdlib", "-nostartfiles"}, t, x_coptions)) - args.push_back ("/DEFAULTLIB:libcmt.lib"); + { + args.push_back ("/DEFAULTLIB:msvcrt"); + args.push_back ("/DEFAULTLIB:oldnames"); + } } // If you look at the list of libraries Visual Studio links by @@ -2496,8 +2498,8 @@ namespace build2 // does). This way the user can override our actions with the // /NODEFAULTLIB option. // - args.push_back ("/DEFAULTLIB:shell32.lib"); - args.push_back ("/DEFAULTLIB:user32.lib"); + args.push_back ("/DEFAULTLIB:shell32"); + args.push_back ("/DEFAULTLIB:user32"); // Take care of the manifest (will be empty for the DLL). // |