diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2020-08-07 21:36:45 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2020-08-12 07:54:02 +0000 |
commit | 14f245ff71b4398dfe059644fc4594b38ae770da (patch) | |
tree | b7044ef1fa1c2f31bc0f2fca25863bcda59e2424 /share/qbs/modules/cpp | |
parent | 5be07c2b1fbe6372d5c2d7b4d339d530fe209fb4 (diff) | |
download | qbs-14f245ff71b4398dfe059644fc4594b38ae770da.tar.gz |
Implement cpp.generateCompilerListingFiles for MSVC toolchain
We need to use the /Fa compiler option as described here:
* https://docs.microsoft.com/en-us/cpp/build/reference/fa-fa-listing-file?view=vs-2019
Change-Id: I81470bfbf84563a49bd5336e7204a07d5b2c910e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share/qbs/modules/cpp')
-rw-r--r-- | share/qbs/modules/cpp/msvc.js | 3 | ||||
-rw-r--r-- | share/qbs/modules/cpp/windows-msvc-base.qbs | 14 |
2 files changed, 14 insertions, 3 deletions
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index 72ee08fe9..df1f5eb5b 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -245,6 +245,9 @@ function prepareCompiler(project, product, inputs, outputs, input, output, expli if (product.cpp.debugInformation && product.cpp.separateDebugInformation) args.push("/Fd" + product.targetName + ".cl" + product.cpp.debugInfoSuffix); + if (input.cpp.generateCompilerListingFiles) + args.push("/Fa" + FileInfo.toWindowsSeparators(outputs.lst[0].filePath)); + var objectMap = outputs.obj || outputs.intermediate_obj var objOutput = objectMap ? objectMap[0] : undefined args.push('/Fo' + FileInfo.toWindowsSeparators(objOutput.filePath)) diff --git a/share/qbs/modules/cpp/windows-msvc-base.qbs b/share/qbs/modules/cpp/windows-msvc-base.qbs index 34132ac49..e88c3f15f 100644 --- a/share/qbs/modules/cpp/windows-msvc-base.qbs +++ b/share/qbs/modules/cpp/windows-msvc-base.qbs @@ -149,15 +149,23 @@ CppModule { auxiliaryInputs: ["hpp"] explicitlyDependsOn: ["c_pch", "cpp_pch"] - outputFileTags: ["obj", "intermediate_obj"] + outputFileTags: ["obj", "intermediate_obj", "lst"] outputArtifacts: { var tags = input.fileTags.contains("cpp_intermediate_object") ? ["intermediate_obj"] : ["obj"]; - return [{ + var artifacts = []; + artifacts.push({ fileTags: tags, filePath: Utilities.getHash(input.baseDir) + "/" + input.fileName + ".obj" - }]; + }); + if (input.cpp.generateCompilerListingFiles) { + artifacts.push({ + fileTags: ["lst"], + filePath: Utilities.getHash(input.baseDir) + "/" + input.fileName + ".lst" + }); + } + return artifacts; } prepare: { |