aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/generator/keiluv/keiluvgenerator.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-08-02 19:30:15 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-08-20 11:29:48 +0000
commit276a969d857922367a65a36b16f885745ea4a5f2 (patch)
tree003e8f638a10a461f20e2968aa33493bc4996b13 /src/plugins/generator/keiluv/keiluvgenerator.cpp
parent17f7e6a79e17fe19e0bf5c6f9189ca513406740d (diff)
baremetal: Long live the KEIL UV project generator for ARM
Right now it is possible to generate a native projects for the KEIL UVision IDE, e.g. using the following command: qbs generate -g keiluv5 -d <path/to/build/directory> -f <path/to/qbs/project> profile:<your/qbs/profile> We need in a valid KEIL QBS profile, from which the generator take a desired target architecture and other stuff. The KEIL UV generator has a semi-intelligent logic, it parses a source QBS project and converts a compiler flags and other stuff to an appropriate configurations of the native KEIL UVsion project. Currently it is supported only one 'keiluv5' generator which allow to generate a projects for the KEIL UVision v5 for ARM architecture. Tested with the KEIL UVision v5.23 for ARM, using as the QBS bare-metal examples, and as other projects. Change-Id: I3af9d01f25a9570a99a62d4ce2c30fec3566b9a1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/generator/keiluv/keiluvgenerator.cpp')
-rw-r--r--src/plugins/generator/keiluv/keiluvgenerator.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/plugins/generator/keiluv/keiluvgenerator.cpp b/src/plugins/generator/keiluv/keiluvgenerator.cpp
index 657a98ad4..e3c959e8d 100644
--- a/src/plugins/generator/keiluv/keiluvgenerator.cpp
+++ b/src/plugins/generator/keiluv/keiluvgenerator.cpp
@@ -35,6 +35,7 @@
#include "keiluvworkspacewriter.h"
#include <generators/generatableprojectiterator.h>
+#include <generators/generatorutils.h>
#include <logging/logger.h>
#include <logging/translator.h>
@@ -43,19 +44,6 @@
namespace qbs {
-static QString targetFilePath(const QString &baseName,
- const QString &baseBuildDirectory)
-{
- return QDir(baseBuildDirectory).absoluteFilePath(
- baseName + QStringLiteral(".uvproj"));
-}
-
-static QString targetFilePath(const GeneratableProductData &product,
- const QString &baseBuildDirectory)
-{
- return targetFilePath(product.name(), baseBuildDirectory);
-}
-
static void writeProjectFiles(const std::map<QString,
std::shared_ptr<KeiluvProject>> &projects,
const Internal::Logger &logger)
@@ -147,8 +135,10 @@ void KeiluvGenerator::visitProduct(
const GeneratableProductData &productData)
{
Q_UNUSED(projectData);
- const QString projectFilePath = targetFilePath(
- productData, project.baseBuildDirectory().absolutePath());
+
+ const QDir baseBuildDir(project.baseBuildDirectory().absolutePath());
+ const QString projFileName = productData.name() + QLatin1String(".uvprojx");
+ const QString projectFilePath = baseBuildDir.absoluteFilePath(projFileName);
const auto targetProject = std::make_shared<KeiluvProject>(
project, productData, m_versionInfo);