ProjectBuilderWorker_windows.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <ProjectBuilderWorker.h>
  9. #include <ProjectManagerDefs.h>
  10. #include <QDir>
  11. #include <QString>
  12. namespace O3DE::ProjectManager
  13. {
  14. AZ::Outcome<QStringList, QString> ProjectBuilderWorker::ConstructCmakeGenerateProjectArguments(const QString& thirdPartyPath) const
  15. {
  16. QString targetBuildPath = QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix);
  17. return AZ::Success(QStringList{ ProjectCMakeCommand,
  18. "-B", targetBuildPath,
  19. "-S", m_projectInfo.m_path,
  20. QString("-DLY_3RDPARTY_PATH=").append(thirdPartyPath) } );
  21. }
  22. AZ::Outcome<QStringList, QString> ProjectBuilderWorker::ConstructCmakeBuildCommandArguments() const
  23. {
  24. const QString targetBuildPath = QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix);
  25. const QString gameLauncherTargetName = m_projectInfo.m_projectName + ".GameLauncher";
  26. const QString serverLauncherTargetName = m_projectInfo.m_projectName + ".ServerLauncher";
  27. const QString unifiedLauncherTargetName = m_projectInfo.m_projectName + ".UnifiedLauncher";
  28. return AZ::Success(QStringList{ ProjectCMakeCommand,
  29. "--build", targetBuildPath,
  30. "--config", "profile",
  31. "--target", gameLauncherTargetName, serverLauncherTargetName, unifiedLauncherTargetName, ProjectCMakeBuildTargetEditor });
  32. }
  33. AZ::Outcome<QStringList, QString> ProjectBuilderWorker::ConstructKillProcessCommandArguments(const QString& pidToKill) const
  34. {
  35. return AZ::Success(QStringList { "cmd.exe", "/C", "taskkill", "/pid", pidToKill, "/f", "/t" } );
  36. }
  37. } // namespace O3DE::ProjectManager