blob: d7f0d8aaa3a6450bf7598c60e497d2645ec798ad [file] [log] [blame]
John Park7eb90422018-01-27 12:04:57 -08001import org.gradle.internal.os.OperatingSystem
2
3if (!project.hasProperty('onlyAthena')) {
4 apply plugin: 'cpp'
5 apply plugin: 'visual-studio'
6 apply plugin: 'edu.wpi.first.NativeUtils'
7
8 ext.gmockProject = true
9
10 apply from: '../config.gradle'
11
12 ext.addGmockToLinker = { binary->
13 binary.lib project: ':gmock', library: 'gmock', linkage: 'static'
14 }
15
16 model {
17 components {
18 gmock(NativeLibrarySpec) {
19 sources {
20 cpp {
21 source {
22 srcDirs = ['src', 'gtest/src']
23 includes = ['*-all.cc']
24 }
25 exportedHeaders {
26 srcDirs = ['include', 'gtest/include', '.', 'gtest']
27 includes = ['**/*.h', '**/*.cc']
28 }
29 }
30 }
31 binaries.all {
32 if (toolChain in VisualCpp) {
33 cppCompiler.args '-D_UNICODE', '-DUNICODE', '-DWIN32', '-D_WIN32', '-DSTRICT', '-DWIN32_LEAN_AND_MEAN', '-D_HAS_EXCEPTIONS=1'
34 } else {
35 cppCompiler.args '-Wall', '-Wshadow', '-fexceptions', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-pthread', '-fPIC'
36 }
37 }
38 binaries.withType(SharedLibraryBinarySpec) {
39 buildable = false
40 }
41 }
42 }
43 }
44}