import org.gradle.internal.os.OperatingSystem | |
if (!project.hasProperty('onlyAthena')) { | |
apply plugin: 'cpp' | |
apply plugin: 'visual-studio' | |
apply plugin: 'edu.wpi.first.NativeUtils' | |
ext.gmockProject = true | |
apply from: '../config.gradle' | |
ext.addGmockToLinker = { binary-> | |
binary.lib project: ':gmock', library: 'gmock', linkage: 'static' | |
} | |
model { | |
components { | |
gmock(NativeLibrarySpec) { | |
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' | |
} | |
} | |
binaries.withType(SharedLibraryBinarySpec) { | |
buildable = false | |
} | |
} | |
} | |
} | |
} |