FalconLibraryCPP/libs/build.gradle

60 lines
1.9 KiB
Groovy
Raw Normal View History

2019-06-26 16:52:16 +00:00
apply plugin: "cpp"
ext.libroot = new File(rootProject.rootDir, "libs")
ext.gtest_root = new File(libroot, "googletest/googletest")
2019-06-26 18:47:47 +00:00
ext.gbench_root = new File(libroot, "benchmark")
2019-06-27 20:47:47 +00:00
ext.units_root = new File(libroot, "units")
2019-06-26 16:52:16 +00:00
model {
components {
googleTest(NativeLibrarySpec) {
sources.cpp {
source {
srcDir new File(gtest_root, "src")
include "**/gtest-all.cc"
}
exportedHeaders {
srcDirs gtest_root, new File(gtest_root, "include")
include "**/*.hpp", "**/*.h"
}
}
}
2019-06-26 18:47:47 +00:00
googleBench(NativeLibrarySpec) {
binaries.all {
if (toolChain instanceof GccCompatibleToolChain) {
cppCompiler.args << '-std=c++14' << '-Wno-deprecated-declarations'
linker.args << '-pthread'
} else {
// MSVC
cppCompiler.args << '/std:c++14'
linker.args << 'shlwapi.lib'
}
}
sources.cpp {
source {
srcDir new File(gbench_root, "src")
include "**/*.cc"
exclude "**/benchmark_main.cc"
}
exportedHeaders {
srcDirs new File(gbench_root, "src"), new File(gbench_root, "include")
include "**/*.hpp", "**/*.h"
}
lib project: ':libs', library: "googleTest", linkage: "static"
}
}
2019-06-27 20:47:47 +00:00
units(NativeLibrarySpec) {
sources.cpp {
source {
srcDir units_root
include "**/*.cpp"
}
exportedHeaders {
srcDirs units_root
include "**/*.h"
}
}
}
}
2019-06-26 16:52:16 +00:00
}