~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/shared/qbs/share/qbs/modules/cpp/gcc.js

  • Committer: Timo Jyrinki
  • Date: 2013-12-02 09:16:15 UTC
  • mfrom: (1.1.29)
  • Revision ID: timo.jyrinki@canonical.com-20131202091615-xbj1os1f604ber1m
New upstream release candidate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
    }
146
146
 
147
147
    var args = []
 
148
    var positionIndependentCode = product.moduleProperty('cpp', 'positionIndependentCode')
148
149
    if (effectiveType === EffectiveTypeEnum.LIB) {
149
 
        if (!product.moduleProperty("qbs", "toolchain").contains("mingw"))
 
150
        if (positionIndependentCode !== false && !product.moduleProperty("qbs", "toolchain").contains("mingw"))
150
151
            args.push('-fPIC');
151
152
    } else if (effectiveType === EffectiveTypeEnum.APP) {
152
 
        var positionIndependentCode = product.moduleProperty('cpp', 'positionIndependentCode')
153
153
        if (positionIndependentCode && !product.moduleProperty("qbs", "toolchain").contains("mingw"))
154
154
            args.push('-fPIE');
155
155
    } else {
167
167
    var cppFlags = ModUtils.moduleProperties(input, 'cppFlags');
168
168
    for (i in cppFlags)
169
169
        args.push('-Wp,' + cppFlags[i])
170
 
    var platformDefines = ModUtils.moduleProperties(input, 'platformDefines');
 
170
    var platformDefines = ModUtils.moduleProperty(input, 'platformDefines');
171
171
    for (i in platformDefines)
172
172
        args.push('-D' + platformDefines[i]);
173
173
    var defines = ModUtils.moduleProperties(input, 'defines');
249
249
        return 'objective-c';
250
250
    else if (fileTag === 'objcpp')
251
251
        return 'objective-c++';
 
252
    else if (fileTag === 'asm')
 
253
        return 'assembler';
 
254
    else if (fileTag === 'asm_cpp')
 
255
        return 'assembler-with-cpp';
252
256
}
253
257
 
254
258
function prepareCompiler(project, product, inputs, outputs, input, output)
257
261
 
258
262
    // Determine which C-language we're compiling
259
263
    var tag = ModUtils.fileTagForTargetLanguage(input.fileTags.concat(output.fileTags));
260
 
    if (!["c", "cpp", "objc", "objcpp"].contains(tag))
261
 
        throw ("unsupported source language");
 
264
    if (!["c", "cpp", "objc", "objcpp", "asm", "asm_cpp"].contains(tag))
 
265
        throw ("unsupported source language: " + tag);
262
266
 
263
267
    // Whether we're compiling a precompiled header or normal source file
264
268
    var pchOutput = outputs[tag + "_pch"] ? outputs[tag + "_pch"][0] : undefined;