This commit is contained in:
s1lent 2018-10-05 14:31:40 +07:00
parent e924a266b0
commit 7aeca162d6
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
2 changed files with 23 additions and 4 deletions

View File

@ -2,11 +2,13 @@ import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils
import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.gradle.nativeplatform.NativeBinarySpec import org.gradle.nativeplatform.NativeBinarySpec
import org.gradle.nativeplatform.NativeLibrarySpec import org.gradle.nativeplatform.NativeLibrarySpec
apply plugin: 'cpp' apply plugin: 'cpp'
apply plugin: IccCompilerPlugin apply plugin: IccCompilerPlugin
apply plugin: GccCompilerPlugin
void setupToolchain(NativeBinarySpec b) { void setupToolchain(NativeBinarySpec b) {
def cfg = rootProject.createToolchainConfig(b) def cfg = rootProject.createToolchainConfig(b)
@ -27,9 +29,11 @@ model {
} }
toolChains { toolChains {
visualCpp(VisualCpp) { visualCpp(VisualCpp)
} if (project.hasProperty("useGcc")) {
icc(Icc) { gcc(Gcc)
} else {
icc(Icc)
} }
} }

View File

@ -237,6 +237,16 @@ class RegamedllSrc {
} }
} }
static void regamedll_tests_gcc_src(def h) {
h.regamedll_tests_gcc_src(CppSourceSet) {
source {
srcDir "unittests"
include "**/*.cpp"
exclude "mathfun_tests.cpp"
}
}
}
static void regamedll_tests_src(def h) { static void regamedll_tests_src(def h) {
h.regamedll_tests_src(CppSourceSet) { h.regamedll_tests_src(CppSourceSet) {
source { source {
@ -291,7 +301,12 @@ model {
sources { sources {
RegamedllSrc.regamedll_pch(it) RegamedllSrc.regamedll_pch(it)
RegamedllSrc.regamedll_src(it) RegamedllSrc.regamedll_src(it)
RegamedllSrc.regamedll_tests_src(it)
if (project.hasProperty("useGcc")) {
RegamedllSrc.regamedll_tests_gcc_src(it)
} else {
RegamedllSrc.regamedll_tests_src(it)
}
} }
binaries.all { NativeBinarySpec b -> project.setupToolchain(b) } binaries.all { NativeBinarySpec b -> project.setupToolchain(b) }