mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
vs2015 is detecting, and printing an error that actually makes sense if it is not. Finally, added a .gitreview file, so that git-review will be able to autodetect the host and project for ntcore automatically. Change-Id: I3cb9910d03d4742619770c91c06e3d5d1ee0f031
46 lines
1.5 KiB
Groovy
46 lines
1.5 KiB
Groovy
import org.apache.tools.ant.taskdefs.condition.Os
|
|
apply plugin: 'cpp'
|
|
apply plugin: 'visual-studio'
|
|
|
|
model {
|
|
toolChains {
|
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
visualCpp(VisualCpp) {
|
|
def vs14Dir = file('C:\\Program Files (x86)\\Microsoft Visual Studio 14.0')
|
|
// If vs2015 is installed, fall back to vs2013 for now, until Gradle pulls in the right
|
|
// includes for the win10 sdk.
|
|
if (vs14Dir.exists()) {
|
|
def vs12Dir = file('C:\\Program Files (x86)\\Microsoft Visual Studio 12.0')
|
|
if (!vs12Dir.exists()) {
|
|
throw new GradleException('Compilation with VS 2015 is not currently supported by Gradle. Please install VS 2013, or use the CMake build option.')
|
|
}
|
|
installDir = vs12Dir
|
|
}
|
|
}
|
|
}
|
|
}
|
|
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', '-lpthreads', '-fPIC'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|