/usr/share/qbs/modules/cpp/GenericGCC.qbs is in qbs-common 1.10.1+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | /****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qbs.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
import qbs 1.0
import qbs.File
import qbs.FileInfo
import qbs.ModUtils
import qbs.PathTools
import qbs.Probes
import qbs.Process
import qbs.Utilities
import qbs.UnixUtils
import qbs.WindowsUtils
import 'gcc.js' as Gcc
CppModule {
condition: qbs.toolchain && qbs.toolchain.contains("gcc")
priority: -100
Probes.BinaryProbe {
id: compilerPathProbe
condition: !toolchainInstallPath && !_skipAllChecks
names: [toolchainPrefix ? toolchainPrefix + compilerName : compilerName]
}
// Find the version as early as possible in case other things depend on it,
// for example the question of whether certain flags are supported and which need to be used
// in the GccProbe itself.
Probes.GccVersionProbe {
id: gccVersionProbe
compilerFilePath: compilerPath
environment: buildEnv
}
Probes.GccProbe {
id: gccProbe
condition: !_skipAllChecks
compilerFilePathByLanguage: compilerPathByLanguage
enableDefinesByLanguage: enableCompilerDefinesByLanguage
environment: buildEnv
flags: targetDriverFlags.concat(sysrootFlags)
_sysroot: sysroot
}
Probes.BinaryProbe {
id: binutilsProbe
condition: !File.exists(archiverPath) && !_skipAllChecks
names: Gcc.toolNames([archiverName, assemblerName, linkerName, nmName,
objcopyName, stripName], toolchainPrefix)
}
targetLinkerFlags: Gcc.targetFlags("linker", false,
target, targetArch, machineType, qbs.targetOS)
targetAssemblerFlags: Gcc.targetFlags("assembler", assemblerHasTargetOption,
target, targetArch, machineType, qbs.targetOS)
targetDriverFlags: Gcc.targetFlags("compiler", compilerHasTargetOption,
target, targetArch, machineType, qbs.targetOS)
Probe {
id: nmProbe
condition: !_skipAllChecks
property string theNmPath: nmPath
property bool hasDynamicOption
configure: {
var proc = new Process();
try {
hasDynamicOption = proc.exec(theNmPath, ["-D", theNmPath], false) == 0;
console.debug("nm has -D: " + hasDynamicOption);
} finally {
proc.close();
}
}
}
qbs.architecture: gccProbe.found ? gccProbe.architecture : original
endianness: gccProbe.endianness
compilerDefinesByLanguage: gccProbe.compilerDefinesByLanguage
compilerVersionMajor: gccVersionProbe.versionMajor
compilerVersionMinor: gccVersionProbe.versionMinor
compilerVersionPatch: gccVersionProbe.versionPatch
compilerIncludePaths: gccProbe.includePaths
compilerFrameworkPaths: gccProbe.frameworkPaths
compilerLibraryPaths: gccProbe.libraryPaths
property bool compilerHasTargetOption: qbs.toolchain.contains("clang")
&& Utilities.versionCompare(compilerVersion, "3.1") >= 0
property bool assemblerHasTargetOption: qbs.toolchain.contains("xcode")
&& Utilities.versionCompare(compilerVersion, "7") >= 0
property string target: targetArch
? [targetArch, targetVendor, targetSystem, targetAbi].join("-")
: undefined
property string targetArch: Utilities.canonicalTargetArchitecture(
qbs.architecture, endianness,
targetVendor, targetSystem, targetAbi)
property string targetVendor: "unknown"
property string targetSystem: "unknown"
property string targetAbi: "unknown"
property string toolchainPrefix
property string toolchainInstallPath: compilerPathProbe.found ? compilerPathProbe.path
: undefined
property string binutilsPath: binutilsProbe.found ? binutilsProbe.path : toolchainInstallPath
assemblerName: 'as'
compilerName: cxxCompilerName
linkerName: 'ld'
property string archiverName: 'ar'
property string nmName: 'nm'
property string objcopyName: "objcopy"
property string stripName: "strip"
property string dsymutilName: "dsymutil"
property string lipoName
property string sysroot: qbs.sysroot
property string syslibroot: sysroot
property stringList sysrootFlags: sysroot ? ["--sysroot=" + sysroot] : []
property string linkerMode: "automatic"
PropertyOptions {
name: "linkerMode"
allowedValues: ["automatic", "manual"]
description: "Controls whether to automatically use an appropriate compiler frontend "
+ "in place of the system linker when linking binaries. The default is \"automatic\", "
+ "which chooses either the C++ compiler, C compiler, or system linker specified by "
+ "the linkerName/linkerPath properties, depending on the type of object files "
+ "present on the linker command line. \"manual\" allows you to explicitly specify "
+ "the linker using the linkerName/linkerPath properties, and allows linker flags "
+ "passed to the linkerFlags and platformLinkerFlags properties to be escaped "
+ "manually (using -Wl or -Xlinker) instead of automatically based on the selected "
+ "linker."
}
property string exportedSymbolsCheckMode: "ignore-undefined"
PropertyOptions {
name: "exportedSymbolsCheckMode"
allowedValues: ["strict", "ignore-undefined"]
description: "Controls when we consider an updated dynamic library as changed with "
+ "regards to other binaries depending on it. The default is \"ignore-undefined\", "
+ "which means we do not care about undefined symbols being added or removed. "
+ "If you do care about that, e.g. because you link dependent products with an option "
+ "such as \"--no-undefined\", then you should set this property to \"strict\"."
}
property string toolchainPathPrefix: Gcc.pathPrefix(toolchainInstallPath, toolchainPrefix)
property string binutilsPathPrefix: Gcc.pathPrefix(binutilsPath, toolchainPrefix)
property string compilerExtension: qbs.hostOS.contains("windows") ? ".exe" : ""
property string cCompilerName: (qbs.toolchain.contains("clang") ? "clang" : "gcc")
+ compilerExtension
property string cxxCompilerName: (qbs.toolchain.contains("clang") ? "clang++" : "g++")
+ compilerExtension
compilerPathByLanguage: ({
"c": toolchainPathPrefix + cCompilerName,
"cpp": toolchainPathPrefix + cxxCompilerName,
"objc": toolchainPathPrefix + cCompilerName,
"objcpp": toolchainPathPrefix + cxxCompilerName,
"asm_cpp": toolchainPathPrefix + cCompilerName
})
assemblerPath: binutilsPathPrefix + assemblerName
compilerPath: toolchainPathPrefix + compilerName
linkerPath: binutilsPathPrefix + linkerName
property string archiverPath: binutilsPathPrefix + archiverName
property string nmPath: binutilsPathPrefix + nmName
property bool _nmHasDynamicOption: nmProbe.hasDynamicOption
property string objcopyPath: binutilsPathPrefix + objcopyName
property string stripPath: binutilsPathPrefix + stripName
property string dsymutilPath: toolchainPathPrefix + dsymutilName
property string lipoPath
property stringList dsymutilFlags
property bool alwaysUseLipo: false
property string includeFlag: "-I"
property string systemIncludeFlag: "-isystem"
readonly property bool shouldCreateSymlinks: {
return createSymlinks && internalVersion && ["macho", "elf"].contains(cpp.imageFormat);
}
property string internalVersion: {
if (product.version === undefined)
return undefined;
if (!Gcc.isNumericProductVersion(product.version)) {
// Dynamic library version numbers like "A" or "B" are common on Apple platforms, so
// don't restrict the product version to a componentized version number here.
if (cpp.imageFormat === "macho")
return product.version;
throw("product.version must be a string in the format x[.y[.z[.w]] "
+ "where each component is an integer");
}
var maxVersionParts = 3;
var versionParts = product.version.split('.').slice(0, maxVersionParts);
// pad if necessary
for (var i = versionParts.length; i < maxVersionParts; ++i)
versionParts.push("0");
return versionParts.join('.');
}
property string soVersion: {
var v = internalVersion;
if (!Gcc.isNumericProductVersion(v))
return "";
return v.split('.')[0];
}
property var buildEnv: {
var env = {};
if (qbs.toolchain.contains("mingw"))
env.PATH = [toolchainInstallPath]; // For libwinpthread etc
return env;
}
exceptionHandlingModel: {
if (qbs.toolchain.contains("mingw")) {
// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html claims
// __USING_SJLJ_EXCEPTIONS__ is defined as 1 when using SJLJ exceptions, but there don't
// seem to be defines for the other models, so use the presence of the DLLs for now.
var prefix = toolchainInstallPath;
if (!qbs.hostOS.contains("windows"))
prefix = FileInfo.joinPaths(toolchainInstallPath, "..", "lib", "gcc",
toolchainPrefix,
[compilerVersionMajor, compilerVersionMinor].join("."));
var models = ["seh", "sjlj", "dw2"];
for (var i = 0; i < models.length; ++i) {
if (File.exists(FileInfo.joinPaths(prefix, "libgcc_s_" + models[i] + "-1.dll"))) {
return models[i];
}
}
}
return base;
}
validate: {
if (_skipAllChecks)
return;
if (!File.exists(compilerPath)) {
var pathMessage = FileInfo.isAbsolutePath(compilerPath)
? "at '" + compilerPath + "'"
: "'" + compilerPath + "' in PATH";
throw ModUtils.ModuleError("Could not find selected C++ compiler " + pathMessage + ". "
+ "Ensure that the compiler is properly "
+ "installed, or set cpp.toolchainInstallPath to a valid "
+ "toolchain path, or consider whether you meant to set "
+ "cpp.compilerName instead.");
}
var validator = new ModUtils.PropertyValidator("cpp");
validator.setRequiredProperty("architecture", architecture,
"you might want to re-run 'qbs-setup-toolchains'");
if (gccProbe.architecture) {
validator.addCustomValidator("architecture", architecture, function (value) {
return Utilities.canonicalArchitecture(architecture) === Utilities.canonicalArchitecture(gccProbe.architecture);
}, "'" + architecture + "' differs from the architecture produced by this compiler (" +
gccProbe.architecture +")");
} else {
// This is a warning and not an error on the rare chance some new architecture comes
// about which qbs does not know about the macros of. But it *might* still work.
if (architecture)
console.warn("Unknown architecture '" + architecture + "' " +
"may not be supported by this compiler.");
}
if (gccProbe.endianness) {
validator.addCustomValidator("endianness", endianness, function (value) {
return endianness === gccProbe.endianness;
}, "'" + endianness + "' differs from the endianness produced by this compiler (" +
gccProbe.endianness + ")");
} else if (endianness) {
console.warn("Could not detect endianness ('" + endianness + "' given)");
}
var validateFlagsFunction = function (value) {
if (value) {
for (var i = 0; i < value.length; ++i) {
if (["-target", "-triple", "-arch"].contains(value[i])
|| value[i].startsWith("-march="))
return false;
}
}
return true;
}
var msg = "'-target', '-triple', '-arch' and '-march' cannot appear in flags; set qbs.architecture instead";
validator.addCustomValidator("assemblerFlags", assemblerFlags, validateFlagsFunction, msg);
validator.addCustomValidator("cppFlags", cppFlags, validateFlagsFunction, msg);
validator.addCustomValidator("cFlags", cFlags, validateFlagsFunction, msg);
validator.addCustomValidator("cxxFlags", cxxFlags, validateFlagsFunction, msg);
validator.addCustomValidator("objcFlags", objcFlags, validateFlagsFunction, msg);
validator.addCustomValidator("objcxxFlags", objcxxFlags, validateFlagsFunction, msg);
validator.addCustomValidator("commonCompilerFlags", commonCompilerFlags, validateFlagsFunction, msg);
validator.addCustomValidator("platformAssemblerFlags", platformAssemblerFlags, validateFlagsFunction, msg);
//validator.addCustomValidator("platformCppFlags", platformCppFlags, validateFlagsFunction, msg);
validator.addCustomValidator("platformCFlags", platformCFlags, validateFlagsFunction, msg);
validator.addCustomValidator("platformCxxFlags", platformCxxFlags, validateFlagsFunction, msg);
validator.addCustomValidator("platformObjcFlags", platformObjcFlags, validateFlagsFunction, msg);
validator.addCustomValidator("platformObjcxxFlags", platformObjcxxFlags, validateFlagsFunction, msg);
validator.addCustomValidator("platformCommonCompilerFlags", platformCommonCompilerFlags, validateFlagsFunction, msg);
validator.setRequiredProperty("compilerVersion", compilerVersion);
validator.setRequiredProperty("compilerVersionMajor", compilerVersionMajor);
validator.setRequiredProperty("compilerVersionMinor", compilerVersionMinor);
validator.setRequiredProperty("compilerVersionPatch", compilerVersionPatch);
validator.addVersionValidator("compilerVersion", compilerVersion, 3, 3);
validator.addRangeValidator("compilerVersionMajor", compilerVersionMajor, 1);
validator.addRangeValidator("compilerVersionMinor", compilerVersionMinor, 0);
validator.addRangeValidator("compilerVersionPatch", compilerVersionPatch, 0);
validator.setRequiredProperty("compilerIncludePaths", compilerIncludePaths);
validator.setRequiredProperty("compilerFrameworkPaths", compilerFrameworkPaths);
validator.setRequiredProperty("compilerLibraryPaths", compilerLibraryPaths);
validator.validate();
}
// Product should be linked if it's not multiplexed or aggregated at all,
// or if it is multiplexed, if it's not the aggregate product
readonly property bool shouldLink: !(product.multiplexed || product.aggregate)
|| product.multiplexConfigurationId
Rule {
id: dynamicLibraryLinker
condition: product.cpp.shouldLink
multiplex: true
inputs: {
var tags = ["obj", "linkerscript", "versionscript"];
if (product.bundle && product.bundle.embedInfoPlist
&& product.qbs.targetOS.contains("darwin")) {
tags.push("aggregate_infoplist");
}
return tags;
}
inputsFromDependencies: ["dynamiclibrary_copy", "staticlibrary"]
outputFileTags: [
"bundle.input",
"dynamiclibrary", "dynamiclibrary_symlink", "dynamiclibrary_copy", "debuginfo_dll"
]
outputArtifacts: {
var artifacts = [{
filePath: product.destinationDirectory + "/"
+ PathTools.dynamicLibraryFilePath(product),
fileTags: ["bundle.input", "dynamiclibrary"],
bundle: {
_bundleFilePath: product.destinationDirectory + "/"
+ PathTools.bundleExecutableFilePath(product)
}
}];
if (!product.qbs.toolchain.contains("mingw")) {
// List of libfoo's public symbols for smart re-linking.
artifacts.push({
filePath: product.destinationDirectory + "/.sosymbols/"
+ PathTools.dynamicLibraryFilePath(product),
fileTags: ["dynamiclibrary_copy"],
alwaysUpdated: false,
});
}
if (product.cpp.shouldCreateSymlinks && (!product.bundle || !product.bundle.isBundle)) {
var maxVersionParts = Gcc.isNumericProductVersion(product.version) ? 3 : 1;
for (var i = 0; i < maxVersionParts; ++i) {
var symlink = {
filePath: product.destinationDirectory + "/"
+ PathTools.dynamicLibraryFilePath(product, undefined, undefined,
i),
fileTags: ["dynamiclibrary_symlink"]
};
if (i > 0 && artifacts[i-1].filePath == symlink.filePath)
break; // Version number has less than three components.
artifacts.push(symlink);
}
}
if (!product.aggregate)
artifacts = artifacts.concat(Gcc.debugInfoArtifacts(product, undefined, "dll"));
return artifacts;
}
prepare: {
return Gcc.prepareLinker.apply(Gcc, arguments);
}
}
Rule {
id: staticLibraryLinker
condition: product.cpp.shouldLink
multiplex: true
inputs: ["obj", "linkerscript"]
inputsFromDependencies: ["dynamiclibrary", "staticlibrary"]
outputFileTags: ["bundle.input", "staticlibrary", "c_staticlibrary", "cpp_staticlibrary"]
outputArtifacts: {
var tags = ["bundle.input", "staticlibrary"];
var objs = inputs["obj"];
var objCount = objs ? objs.length : 0;
for (var i = 0; i < objCount; ++i) {
var ft = objs[i].fileTags;
if (ft.contains("c_obj"))
tags.push("c_staticlibrary");
if (ft.contains("cpp_obj"))
tags.push("cpp_staticlibrary");
}
return [{
filePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.staticLibraryFilePath(product)),
fileTags: tags,
bundle: {
_bundleFilePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.bundleExecutableFilePath(product))
}
}];
}
prepare: {
var args = ['rcs', output.filePath];
for (var i in inputs.obj)
args.push(inputs.obj[i].filePath);
var cmd = new Command(product.cpp.archiverPath, args);
cmd.description = 'creating ' + output.fileName;
cmd.highlight = 'linker'
cmd.responseFileUsagePrefix = '@';
return cmd;
}
}
Rule {
id: loadableModuleLinker
condition: product.cpp.shouldLink
multiplex: true
inputs: {
var tags = ["obj", "linkerscript"];
if (product.bundle && product.bundle.embedInfoPlist
&& product.qbs.targetOS.contains("darwin")) {
tags.push("aggregate_infoplist");
}
return tags;
}
inputsFromDependencies: ["dynamiclibrary_copy", "staticlibrary"]
outputFileTags: ["bundle.input", "loadablemodule", "debuginfo_loadablemodule"]
outputArtifacts: {
var app = {
filePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.loadableModuleFilePath(product)),
fileTags: ["bundle.input", "loadablemodule"],
bundle: {
_bundleFilePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.bundleExecutableFilePath(product))
}
}
var artifacts = [app];
if (!product.aggregate)
artifacts = artifacts.concat(Gcc.debugInfoArtifacts(product, undefined,
"loadablemodule"));
return artifacts;
}
prepare: {
return Gcc.prepareLinker.apply(Gcc, arguments);
}
}
Rule {
id: applicationLinker
condition: product.cpp.shouldLink
multiplex: true
inputs: {
var tags = ["obj", "linkerscript"];
if (product.bundle && product.bundle.embedInfoPlist
&& product.qbs.targetOS.contains("darwin")) {
tags.push("aggregate_infoplist");
}
return tags;
}
inputsFromDependencies: ["dynamiclibrary_copy", "staticlibrary"]
outputFileTags: ["bundle.input", "application", "debuginfo_app"]
outputArtifacts: {
var app = {
filePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.applicationFilePath(product)),
fileTags: ["bundle.input", "application"],
bundle: {
_bundleFilePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.bundleExecutableFilePath(product))
}
}
var artifacts = [app];
if (!product.aggregate)
artifacts = artifacts.concat(Gcc.debugInfoArtifacts(product, undefined, "app"));
return artifacts;
}
prepare: {
return Gcc.prepareLinker.apply(Gcc, arguments);
}
}
Rule {
id: compiler
inputs: ["cpp", "c", "objcpp", "objc", "asm_cpp"]
auxiliaryInputs: ["hpp"]
explicitlyDependsOn: ["c_pch", "cpp_pch", "objc_pch", "objcpp_pch"]
outputFileTags: ["obj", "c_obj", "cpp_obj"]
outputArtifacts: {
var tags = ["obj"];
if (inputs.c || inputs.objc)
tags.push("c_obj");
if (inputs.cpp || inputs.objcpp)
tags.push("cpp_obj");
return [{
fileTags: tags,
filePath: FileInfo.joinPaths(Utilities.getHash(input.baseDir),
input.fileName + ".o")
}];
}
prepare: {
return Gcc.prepareCompiler.apply(Gcc, arguments);
}
}
Rule {
id: assembler
inputs: ["asm"]
Artifact {
fileTags: ["obj"]
filePath: FileInfo.joinPaths(Utilities.getHash(input.baseDir), input.fileName + ".o")
}
prepare: {
return Gcc.prepareAssembler.apply(Gcc, arguments);
}
}
Rule {
condition: useCPrecompiledHeader
inputs: ["c_pch_src"]
auxiliaryInputs: ["hpp"]
Artifact {
filePath: product.name + "_c.gch"
fileTags: ["c_pch"]
}
prepare: {
return Gcc.prepareCompiler.apply(Gcc, arguments);
}
}
Rule {
condition: useCxxPrecompiledHeader
inputs: ["cpp_pch_src"]
auxiliaryInputs: ["hpp"]
Artifact {
filePath: product.name + "_cpp.gch"
fileTags: ["cpp_pch"]
}
prepare: {
return Gcc.prepareCompiler.apply(Gcc, arguments);
}
}
Rule {
condition: useObjcPrecompiledHeader
inputs: ["objc_pch_src"]
auxiliaryInputs: ["hpp"]
Artifact {
filePath: product.name + "_objc.gch"
fileTags: ["objc_pch"]
}
prepare: {
return Gcc.prepareCompiler.apply(Gcc, arguments);
}
}
Rule {
condition: useObjcxxPrecompiledHeader
inputs: ["objcpp_pch_src"]
auxiliaryInputs: ["hpp"]
Artifact {
filePath: product.name + "_objcpp.gch"
fileTags: ["objcpp_pch"]
}
prepare: {
return Gcc.prepareCompiler.apply(Gcc, arguments);
}
}
FileTagger {
patterns: "*.s"
fileTags: ["asm"]
}
FileTagger {
patterns: "*.S"
fileTags: ["asm_cpp"]
}
FileTagger {
patterns: "*.sx"
fileTags: ["asm_cpp"]
}
}
|