diff options
author | Halfdan Ingvarsson <[email protected]> | 2019-01-31 15:13:27 -0500 |
---|---|---|
committer | Christian Kandeler <[email protected]> | 2020-01-09 13:58:53 +0000 |
commit | 81a32df63386ba11da74f8efd9281195552807c7 (patch) | |
tree | 359a96a1a3ec658f2486be7d3597c6699adab52c /src/plugins/qmakeprojectmanager/qmakemakestep.cpp | |
parent | 0a33e0eebee1e044a4a810d65eb6fbbc6ca315b4 (diff) |
Fix build file when 'object_parallel_to_source' is enabled
If running 'Build File' and the 'objects_parallel_to_source' CONFIG
option is set for the project, make sure to modify the object file's
path so that it's target location is the relative to the build root
in the same way its source file's location is relative to the source
root.
- Add an accessor in QmakeProFileNode to check whether the
'objects_parallel_to_source' CONFIG option is set.
- Modify the object directory in QmakeMakeStep::init to ensure that it
has the same relative path to the object file from the build root,
as its source file has relative to the source root.
Fixes: QTCREATORBUG-18136
Change-Id: I63ef3af1fd4b7ef9fc46959f44d88b8025e99238
Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src/plugins/qmakeprojectmanager/qmakemakestep.cpp')
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakemakestep.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp index 79048cc9ab2..c6c2e6a6dee 100644 --- a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp @@ -140,6 +140,16 @@ bool QmakeMakeStep::init() objectsDir += "/release"; } } + + if (subProFile->isObjectParallelToSource()) { + const Utils::FilePath sourceFileDir = bc->fileNodeBuild()->filePath().parentDir(); + const Utils::FilePath proFileDir = subProFile->proFile()->sourceDir().canonicalPath(); + if (!objectsDir.endsWith('/')) + objectsDir += QLatin1Char('/'); + objectsDir += sourceFileDir.relativeChildPath(proFileDir).toString(); + objectsDir = QDir::cleanPath(objectsDir); + } + QString relObjectsDir = QDir(pp->workingDirectory().toString()) .relativeFilePath(objectsDir); if (relObjectsDir == ".") |