2017-02-10 23:51:22 +03:00
|
|
|
import org.doomedsociety.gradlecpp.cfg.BinaryKind
|
|
|
|
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
|
|
|
|
import org.doomedsociety.gradlecpp.gcc.OptimizationLevel
|
|
|
|
|
|
|
|
rootProject.ext.createGccConfig = { boolean release, BinaryKind binKind ->
|
|
|
|
GccToolchainConfig cfg
|
|
|
|
if (release) {
|
|
|
|
cfg = new GccToolchainConfig(
|
|
|
|
compilerOptions: new GccToolchainConfig.CompilerOptions(
|
|
|
|
optimizationLevel: OptimizationLevel.LEVEL_3,
|
|
|
|
stackProtector: false,
|
|
|
|
//interProceduralOptimizations: true,
|
|
|
|
|
|
|
|
noBuiltIn: true,
|
|
|
|
|
|
|
|
//intelExtensions: false,
|
|
|
|
//asmBlocks: true,
|
|
|
|
|
|
|
|
positionIndependentCode: false
|
|
|
|
),
|
|
|
|
|
|
|
|
linkerOptions: new GccToolchainConfig.LinkerOptions(
|
|
|
|
//interProceduralOptimizations: true,
|
|
|
|
stripSymbolTable: true,
|
2017-02-14 19:29:46 +03:00
|
|
|
staticLibGcc: false,
|
2017-02-10 23:51:22 +03:00
|
|
|
//staticIntel: true,
|
2017-02-14 17:27:57 +03:00
|
|
|
staticLibStdCpp: false,
|
2017-02-10 23:51:22 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
librarianOptions: new GccToolchainConfig.LibrarianOptions(
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
//debug
|
|
|
|
cfg = new GccToolchainConfig(
|
|
|
|
compilerOptions: new GccToolchainConfig.CompilerOptions(
|
|
|
|
optimizationLevel: OptimizationLevel.DISABLE,
|
|
|
|
stackProtector: true,
|
|
|
|
//interProceduralOptimizations: false,
|
|
|
|
|
|
|
|
noBuiltIn: true,
|
|
|
|
//intelExtensions: false,
|
|
|
|
//asmBlocks: true
|
|
|
|
),
|
|
|
|
|
|
|
|
linkerOptions: new GccToolchainConfig.LinkerOptions(
|
|
|
|
//interProceduralOptimizations: false,
|
|
|
|
stripSymbolTable: false,
|
2017-02-14 19:29:46 +03:00
|
|
|
staticLibGcc: false,
|
2017-02-10 23:51:22 +03:00
|
|
|
//staticIntel: true,
|
2017-02-14 17:27:57 +03:00
|
|
|
staticLibStdCpp: false,
|
2017-02-10 23:51:22 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
librarianOptions: new GccToolchainConfig.LibrarianOptions(
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2017-04-24 00:26:43 +03:00
|
|
|
cfg.singleDefines('LINUX')
|
2017-02-10 23:51:22 +03:00
|
|
|
return cfg
|
|
|
|
}
|