2017-02-11 01:51:22 +05: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,
|
|
|
|
|
2017-07-24 01:09:08 +07:00
|
|
|
positionIndependentCode: false,
|
|
|
|
|
|
|
|
extraDefines: [
|
|
|
|
'_GLIBCXX_USE_CXX11_ABI': 0,
|
|
|
|
]
|
2017-02-11 01:51:22 +05:00
|
|
|
),
|
|
|
|
|
|
|
|
linkerOptions: new GccToolchainConfig.LinkerOptions(
|
|
|
|
//interProceduralOptimizations: true,
|
2017-09-29 19:55:05 +04:00
|
|
|
stripSymbolTable: false,
|
2017-02-14 21:29:46 +05:00
|
|
|
staticLibGcc: false,
|
2017-02-11 01:51:22 +05:00
|
|
|
//staticIntel: true,
|
2017-02-14 21:27:57 +07:00
|
|
|
staticLibStdCpp: false,
|
2017-02-11 01:51:22 +05: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,
|
2017-07-24 01:09:08 +07:00
|
|
|
//asmBlocks: true,
|
|
|
|
|
|
|
|
extraDefines: [
|
|
|
|
'_GLIBCXX_USE_CXX11_ABI': 0,
|
|
|
|
]
|
2017-02-11 01:51:22 +05:00
|
|
|
),
|
|
|
|
|
|
|
|
linkerOptions: new GccToolchainConfig.LinkerOptions(
|
|
|
|
//interProceduralOptimizations: false,
|
|
|
|
stripSymbolTable: false,
|
2017-02-14 21:29:46 +05:00
|
|
|
staticLibGcc: false,
|
2017-02-11 01:51:22 +05:00
|
|
|
//staticIntel: true,
|
2017-02-14 21:27:57 +07:00
|
|
|
staticLibStdCpp: false,
|
2017-02-11 01:51:22 +05:00
|
|
|
),
|
|
|
|
|
|
|
|
librarianOptions: new GccToolchainConfig.LibrarianOptions(
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2017-12-05 22:55:45 +07:00
|
|
|
cfg.singleDefines('LINUX', '_LINUX')
|
2017-02-11 01:51:22 +05:00
|
|
|
return cfg
|
|
|
|
}
|