mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Refactor subcommand addition for sharing. (#4474)
Trying to standardize the setup a little more.
This commit is contained in:
@@ -9,18 +9,6 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
constexpr CommandLine::CommandInfo LinkOptions::Info = {
|
||||
.name = "link",
|
||||
.help = R"""(
|
||||
Link Carbon executables.
|
||||
|
||||
This subcommand links Carbon executables by combining object files.
|
||||
|
||||
TODO: Support linking binary libraries, both archives and shared libraries.
|
||||
TODO: Support linking against binary libraries.
|
||||
)""",
|
||||
};
|
||||
|
||||
auto LinkOptions::Build(CommandLine::CommandBuilder& b) -> void {
|
||||
b.AddStringPositionalArg(
|
||||
{
|
||||
@@ -80,6 +68,20 @@ static void AddOSFlags(llvm::StringRef target,
|
||||
}
|
||||
}
|
||||
|
||||
static constexpr CommandLine::CommandInfo SubcommandInfo = {
|
||||
.name = "link",
|
||||
.help = R"""(
|
||||
Link Carbon executables.
|
||||
|
||||
This subcommand links Carbon executables by combining object files.
|
||||
|
||||
TODO: Support linking binary libraries, both archives and shared libraries.
|
||||
TODO: Support linking against binary libraries.
|
||||
)""",
|
||||
};
|
||||
|
||||
LinkSubcommand::LinkSubcommand() : DriverSubcommand(SubcommandInfo) {}
|
||||
|
||||
auto LinkSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
|
||||
// TODO: Currently we use the Clang driver to link. This works well on Unix
|
||||
// OSes but we likely need to directly build logic to invoke `link.exe` on
|
||||
|
||||
Reference in New Issue
Block a user