diff options
| author | Tim Sander <tim@krieglstein.org> | 2013-10-31 15:00:57 +0100 |
|---|---|---|
| committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-11-07 12:39:11 +0100 |
| commit | a700730a5bc34848ac9552c8f695fdb0bdb6b153 (patch) | |
| tree | 0f3456e7294a64e520575638943d8376a13f857b /share | |
| parent | 81e3da6732c374c76e785de04759fe18e5b5fcd2 (diff) | |
| download | qbs-a700730a5bc34848ac9552c8f695fdb0bdb6b153.tar.gz | |
Add support for compiling assembler files with GCC.
Task-number: QBS-437
Change-Id: I7d4b64df16f5a260d41a6d34335fe0cc1a36b712
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'share')
| -rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 17 | ||||
| -rw-r--r-- | share/qbs/modules/cpp/gcc.js | 8 | ||||
| -rw-r--r-- | share/qbs/modules/utils.js | 2 |
3 files changed, 23 insertions, 4 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index 2c9950062..35821fdeb 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -272,7 +272,7 @@ CppModule { Rule { id: compiler - inputs: ["cpp", "c", "objcpp", "objc"] + inputs: ["cpp", "c", "objcpp", "objc", "asm", "asm_cpp"] auxiliaryInputs: ["hpp"] explicitlyDependsOn: ["c_pch", "cpp_pch", "objc_pch", "objcpp_pch"] @@ -333,4 +333,19 @@ CppModule { return Gcc.prepareCompiler.apply(this, arguments); } } + + FileTagger { + pattern: "*.s" + fileTags: ["asm"] + } + + FileTagger { + pattern: "*.S" + fileTags: ["asm_cpp"] + } + + FileTagger { + pattern: "*.sx" + fileTags: ["asm_cpp"] + } } diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index bbb056e6d..6dc75a041 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -249,6 +249,10 @@ function languageName(fileTag) return 'objective-c'; else if (fileTag === 'objcpp') return 'objective-c++'; + else if (fileTag === 'asm') + return 'assembler'; + else if (fileTag === 'asm_cpp') + return 'assembler-with-cpp'; } function prepareCompiler(project, product, inputs, outputs, input, output) @@ -257,8 +261,8 @@ function prepareCompiler(project, product, inputs, outputs, input, output) // Determine which C-language we're compiling var tag = ModUtils.fileTagForTargetLanguage(input.fileTags.concat(output.fileTags)); - if (!["c", "cpp", "objc", "objcpp"].contains(tag)) - throw ("unsupported source language"); + if (!["c", "cpp", "objc", "objcpp", "asm", "asm_cpp"].contains(tag)) + throw ("unsupported source language: " + tag); // Whether we're compiling a precompiled header or normal source file var pchOutput = outputs[tag + "_pch"] ? outputs[tag + "_pch"][0] : undefined; diff --git a/share/qbs/modules/utils.js b/share/qbs/modules/utils.js index 9d187d01f..28952fdfa 100644 --- a/share/qbs/modules/utils.js +++ b/share/qbs/modules/utils.js @@ -11,7 +11,7 @@ */ function fileTagForTargetLanguage(fileTags) { - var srcTags = ["c", "cpp", "objc", "objcpp"]; + var srcTags = ["c", "cpp", "objc", "objcpp", "asm", "asm_cpp"]; var pchTags = ["c_pch", "cpp_pch", "objc_pch", "objcpp_pch"]; var canonicalTag = undefined; |
