mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
no-unused-private-field for Mac builds. Gradle also now works with the classifier-based dependency system, rather than having separate repos for every level. Change-Id: I2eb87391181e91b5675e3e982e4d915be83e14ea
54 lines
1.8 KiB
Groovy
54 lines
1.8 KiB
Groovy
import org.gradle.internal.os.OperatingSystem
|
|
|
|
apply plugin: 'cpp'
|
|
apply plugin: 'visual-studio'
|
|
|
|
// Apply the correct toolchain settings for the target platform
|
|
if (buildPlatform == 'arm') {
|
|
apply from: '../toolchains/arm.gradle'
|
|
} else if (OperatingSystem.current().isLinux()) {
|
|
apply from: '../toolchains/linux.gradle'
|
|
} else if (OperatingSystem.current().isMacOsX()) {
|
|
apply from: '../toolchains/mac.gradle'
|
|
} else if (OperatingSystem.current().isWindows()) {
|
|
apply from: '../toolchains/windows.gradle'
|
|
} else {
|
|
throw new GradleException("ntcore does not support building on ${OperatingSystem.current().getFamilyName()}.")
|
|
}
|
|
|
|
model {
|
|
platforms {
|
|
x86 {
|
|
architecture 'x86'
|
|
}
|
|
x64 {
|
|
architecture 'x86_64'
|
|
}
|
|
}
|
|
components {
|
|
gmock(NativeLibrarySpec) {
|
|
targetPlatform 'x86'
|
|
targetPlatform 'x64'
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDirs = ['src', 'gtest/src']
|
|
includes = ['*-all.cc']
|
|
}
|
|
exportedHeaders {
|
|
srcDirs = ['include', 'gtest/include', '.', 'gtest']
|
|
includes = ['**/*.h', '**/*.cc']
|
|
}
|
|
}
|
|
}
|
|
binaries.all {
|
|
if (toolChain in VisualCpp) {
|
|
cppCompiler.args '-D_UNICODE', '-DUNICODE', '-DWIN32', '-D_WIN32', '-DSTRICT', '-DWIN32_LEAN_AND_MEAN', '-D_HAS_EXCEPTIONS=1'
|
|
} else {
|
|
cppCompiler.args '-Wall', '-Wshadow', '-fexceptions', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-pthread', '-fPIC'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|