John Park | 7eb9042 | 2018-01-27 12:04:57 -0800 | [diff] [blame] | 1 | import org.gradle.internal.os.OperatingSystem |
| 2 | |
| 3 | if (!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 | model { |
| 13 | components { |
| 14 | gmock(NativeLibrarySpec) { |
| 15 | sources { |
| 16 | cpp { |
| 17 | source { |
| 18 | srcDirs = ['src', 'gtest/src'] |
| 19 | includes = ['*-all.cc'] |
| 20 | } |
| 21 | exportedHeaders { |
| 22 | srcDirs = ['include', 'gtest/include', '.', 'gtest'] |
| 23 | includes = ['**/*.h', '**/*.cc'] |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | binaries.all { |
| 28 | if (toolChain in VisualCpp) { |
| 29 | cppCompiler.args '-D_UNICODE', '-DUNICODE', '-DWIN32', '-D_WIN32', '-DSTRICT', '-DWIN32_LEAN_AND_MEAN', '-D_HAS_EXCEPTIONS=1' |
| 30 | } else { |
| 31 | cppCompiler.args '-Wall', '-Wshadow', '-fexceptions', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-pthread', '-fPIC' |
| 32 | } |
| 33 | } |
| 34 | binaries.withType(SharedLibraryBinarySpec) { |
| 35 | buildable = false |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | } |