Index: tools/gn/command_gen.cc |
diff --git a/tools/gn/command_gen.cc b/tools/gn/command_gen.cc |
index fee3f1a31f836c7843eac42afdeb918722c43413..b0f84e5ff49d92909229b4596e90aa2df62e55d0 100644 |
--- a/tools/gn/command_gen.cc |
+++ b/tools/gn/command_gen.cc |
@@ -13,6 +13,7 @@ |
#include "tools/gn/eclipse_writer.h" |
#include "tools/gn/ninja_target_writer.h" |
#include "tools/gn/ninja_writer.h" |
+#include "tools/gn/qt_creator_writer.h" |
#include "tools/gn/runtime_deps.h" |
#include "tools/gn/scheduler.h" |
#include "tools/gn/setup.h" |
@@ -29,9 +30,11 @@ const char kSwitchCheck[] = "check"; |
const char kSwitchFilters[] = "filters"; |
const char kSwitchIde[] = "ide"; |
const char kSwitchIdeValueEclipse[] = "eclipse"; |
+const char kSwitchIdeValueQtCreator[] = "qtcreator"; |
const char kSwitchIdeValueVs[] = "vs"; |
const char kSwitchIdeValueVs2013[] = "vs2013"; |
const char kSwitchIdeValueVs2015[] = "vs2015"; |
+const char kSwitchRootProjectTarget[] = "root-project-target"; |
const char kSwitchSln[] = "sln"; |
// Called on worker thread to write the ninja file. |
@@ -188,6 +191,18 @@ bool RunIdeWriter(const std::string& ide, |
"ms\n"); |
} |
return res; |
+ } else if (ide == kSwitchIdeValueQtCreator) { |
+ std::string root_target; |
+ if (command_line->HasSwitch(kSwitchRootProjectTarget)) |
+ root_target = command_line->GetSwitchValueASCII(kSwitchRootProjectTarget); |
+ bool res = QtCreatorWriter::RunAndWriteFile(build_settings, builder, err, |
+ root_target); |
+ if (res && !command_line->HasSwitch(switches::kQuiet)) { |
+ OutputString("Generating QtCreator project took " + |
+ base::Int64ToString(timer.Elapsed().InMilliseconds()) + |
+ "ms\n"); |
+ } |
+ return res; |
} |
*err = Err(Location(), "Unknown IDE: " + ide); |
@@ -225,6 +240,7 @@ const char kGen_Help[] = |
" (default Visual Studio version: 2015)\n" |
" \"vs2013\" - Visual Studio 2013 project/solution files.\n" |
" \"vs2015\" - Visual Studio 2015 project/solution files.\n" |
+ " \"qtcreator\" - QtCreator project directory." |
brucedawson
2016/05/09 18:56:49
This should say "QtCreator project file.s" not "pr
Krzysztof Olczyk
2016/05/10 08:11:18
Done
|
"\n" |
" --sln=<file_name>\n" |
" Override default sln file name (\"all\"). Solution file is written\n" |
@@ -235,6 +251,10 @@ const char kGen_Help[] = |
" of generated projects (see \"gn help label_pattern\"). Only\n" |
" matching targets will be included to the solution. Only for Visual\n" |
" Studio.\n" |
+ " --root-target=<target_name>\n" |
+ " Name of the root target for which the project will be generated\n" |
+ " to contain files of it and its dependencies. Omitting it traverses\n" |
+ " the whole build graph. Only for QtCreator.\n" |
"\n" |
"Eclipse IDE Support\n" |
"\n" |