diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2021-01-29 12:42:38 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2021-01-29 12:57:44 +0000 |
commit | 55337b8ceb042fa3df89629f0c3d96d04e008270 (patch) | |
tree | 63508061a8612085114977aeae7252d3a51aff00 /share/qbs | |
parent | 883d7c03ab80c74b0c1e4ce85345e93beec3bf44 (diff) | |
download | qbs-55337b8ceb042fa3df89629f0c3d96d04e008270.tar.gz |
baremetal: Handle cpp.prefixHeaders property in IAR assembler
We need to pass the `--preinclude` option and to the assembler
too in case the `cpp.prefixHeaders` is not empty.
One caveat is that this option is not supported on all architectures
and we need to handle it properly.
Change-Id: I31eda38a8f400a0534a43d141ee64aef405fa683
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs')
-rw-r--r-- | share/qbs/modules/cpp/iar.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/share/qbs/modules/cpp/iar.js b/share/qbs/modules/cpp/iar.js index 0cead91c3..9e40223df 100644 --- a/share/qbs/modules/cpp/iar.js +++ b/share/qbs/modules/cpp/iar.js @@ -794,6 +794,16 @@ function assemblerFlags(project, product, input, outputs, explicitlyDependsOn) { // Output. args.push("-o", outputs.obj[0].filePath); + var architecture = input.qbs.architecture; + + // The `--preinclude` flag is only supported for a certain + // set of assemblers, not for all. + if (supportIAssembler(architecture)) { + var prefixHeaders = input.cpp.prefixHeaders; + for (var i in prefixHeaders) + args.push("--preinclude", prefixHeaders[i]); + } + // Includes. var allIncludePaths = []; var systemIncludePaths = input.cpp.systemIncludePaths; @@ -809,7 +819,6 @@ function assemblerFlags(project, product, input, outputs, explicitlyDependsOn) { args.push("-r"); // Architecture specific flags. - var architecture = input.qbs.architecture; if (supportIAssembler(architecture)) { // Silent output generation flag. args.push("--silent"); |