2016-08-14 12:38:13 -07:00
|
|
|
model {
|
|
|
|
|
toolChains {
|
|
|
|
|
clang(Clang) {
|
|
|
|
|
target('x86') {
|
|
|
|
|
cppCompiler.withArguments { args ->
|
|
|
|
|
args << '-std=c++11' << '-Wall' << '-Wextra' << '-Werror' << '-pedantic-errors'
|
|
|
|
|
args << '-fPIC' << '-m32'
|
|
|
|
|
args << '-Wno-unused-parameter' << '-Wno-missing-field-initializers' << '-Wno-unused-private-field'
|
|
|
|
|
}
|
|
|
|
|
linker.withArguments { args ->
|
|
|
|
|
args << '-m32'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
target('x64') {
|
|
|
|
|
cppCompiler.withArguments { args ->
|
|
|
|
|
args << '-std=c++11' << '-Wall' << '-Wextra' << '-Werror' << '-pedantic-errors'
|
|
|
|
|
args << '-fPIC'
|
|
|
|
|
args << '-Wno-missing-field-initializers' << '-Wno-unused-private-field' << '-Wno-unused-parameter'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ext.setupReleaseDefines = { cppCompiler, linker ->
|
|
|
|
|
cppCompiler.args '-O2'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ext.setupDebugDefines = { cppCompiler, linker ->
|
|
|
|
|
cppCompiler.args '-g', '-O0'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Used only on Windows.
|
|
|
|
|
ext.setupDef = { linker, deffile -> }
|
|
|
|
|
|
2016-10-21 18:43:55 -07:00
|
|
|
ext.debugStripSetup = {
|
|
|
|
|
if (!project.hasProperty('debug')) {
|
|
|
|
|
project.tasks.whenObjectAdded { task ->
|
|
|
|
|
if (task.name.contains('link') && task.name.contains('SharedLibrary')) {
|
|
|
|
|
def library = task.outputFile.absolutePath
|
|
|
|
|
task.doLast {
|
|
|
|
|
exec { commandLine "dsymutil", library }
|
|
|
|
|
exec { commandLine "strip", '-S', library }
|
2016-08-14 12:38:13 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|