Remove one of the overridden meaning of --root-target flag CL https://gn-review.googlesource.com/c/gn/+/10140 overrode the meaning of the --root-target used by Xcode and QtCreator project generators to designate the default target to build. Rename the flag used by project generator to --ide-root-target to avoid having two separate flags with the same meaning. Bug: chromium:1133101 Change-Id: I8f95904af0bf4443703a6e634ef1096cd9916f48 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/10580 Reviewed-by: Brett Wilson <brettw@chromium.org> Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
diff --git a/docs/reference.md b/docs/reference.md index 2a987ba..b321129 100644 --- a/docs/reference.md +++ b/docs/reference.md
@@ -786,7 +786,7 @@ This string is passed without any quoting to the ninja invocation command-line. Can be used to configure ninja flags, like "-j". - --root-target=<target_name> + --ide-root-target=<target_name> Name of the target corresponding to "All" target in Xcode. If unset, "All" invokes ninja without any target and builds everything. ``` @@ -794,7 +794,7 @@ #### **QtCreator Flags** ``` - --root-target=<target_name> + --ide-root-target=<target_name> Name of the root target for which the QtCreator project will be generated to contain files of it and its dependencies. If unset, the whole build graph will be emitted.
diff --git a/src/gn/command_gen.cc b/src/gn/command_gen.cc index b3f0633..a014298 100644 --- a/src/gn/command_gen.cc +++ b/src/gn/command_gen.cc
@@ -43,10 +43,10 @@ const char kSwitchIdeValueWinSdk[] = "winsdk"; const char kSwitchIdeValueXcode[] = "xcode"; const char kSwitchIdeValueJson[] = "json"; +const char kSwitchIdeRootTarget[] = "ide-root-target"; const char kSwitchNinjaExecutable[] = "ninja-executable"; const char kSwitchNinjaExtraArgs[] = "ninja-extra-args"; const char kSwitchNoDeps[] = "no-deps"; -const char kSwitchRootTarget[] = "root-target"; const char kSwitchSln[] = "sln"; const char kSwitchXcodeProject[] = "xcode-project"; const char kSwitchXcodeBuildSystem[] = "xcode-build-system"; @@ -242,7 +242,7 @@ } else if (ide == kSwitchIdeValueXcode) { XcodeWriter::Options options = { command_line->GetSwitchValueASCII(kSwitchXcodeProject), - command_line->GetSwitchValueASCII(kSwitchRootTarget), + command_line->GetSwitchValueASCII(kSwitchIdeRootTarget), command_line->GetSwitchValueASCII(kSwitchNinjaExecutable), command_line->GetSwitchValueASCII(kSwitchFilters), XcodeBuildSystem::kLegacy, @@ -275,8 +275,8 @@ return res; } else if (ide == kSwitchIdeValueQtCreator) { std::string root_target; - if (command_line->HasSwitch(kSwitchRootTarget)) - root_target = command_line->GetSwitchValueASCII(kSwitchRootTarget); + if (command_line->HasSwitch(kSwitchIdeRootTarget)) + root_target = command_line->GetSwitchValueASCII(kSwitchIdeRootTarget); bool res = QtCreatorWriter::RunAndWriteFile(build_settings, builder, err, root_target); if (res && !quiet) { @@ -435,13 +435,13 @@ This string is passed without any quoting to the ninja invocation command-line. Can be used to configure ninja flags, like "-j". - --root-target=<target_name> + --ide-root-target=<target_name> Name of the target corresponding to "All" target in Xcode. If unset, "All" invokes ninja without any target and builds everything. QtCreator Flags - --root-target=<target_name> + --ide-root-target=<target_name> Name of the root target for which the QtCreator project will be generated to contain files of it and its dependencies. If unset, the whole build graph will be emitted.