From 85399cf60764b0fe54d44d4a5bacb54feae8dd62 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Jun 2019 15:01:41 +0200 Subject: Add support for [config.]{cc,c,cxx}.aoptions (archive options) In particular, this can be used to suppress lib.exe warnings, for example: cc.aoptions += /IGNORE:4221 --- build2/cc/link-rule.cxx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'build2/cc/link-rule.cxx') diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index 3b58ab7..588f3ae 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -1870,7 +1870,15 @@ namespace build2 { if (tsys == "win32-msvc") { - // No options for lib.exe. + // lib.exe has /LIBPATH but it's not clear/documented what it's used + // for. Perhaps for link-time code generation (/LTCG)? If that's the + // case, then we may need to pass *.loptions. + // + args.push_back ("/NOLOGO"); + + // Add /MACHINE. + // + args.push_back (msvc_machine (cast (rs[x_target_cpu]))); } else { @@ -1914,6 +1922,9 @@ namespace build2 args.push_back (arg1.c_str ()); } + + append_options (args, t, c_aoptions); + append_options (args, t, x_aoptions); } else { @@ -2172,16 +2183,6 @@ namespace build2 if (tsys == "win32-msvc") { - // lib.exe has /LIBPATH but it's not clear/documented what it's used - // for. Perhaps for link-time code generation (/LTCG)? If that's the - // case, then we may need to pass *.loptions. - // - args.push_back ("/NOLOGO"); - - // Add /MACHINE. - // - args.push_back (msvc_machine (cast (rs[x_target_cpu]))); - out = "/OUT:" + relt.string (); args.push_back (out.c_str ()); } -- cgit v1.1