Skip to content

Commit

Permalink
Resolved #307
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Oct 5, 2018
1 parent e924a26 commit 7aeca16
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
10 changes: 7 additions & 3 deletions dep/cppunitlite/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils
import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.gradle.nativeplatform.NativeBinarySpec
import org.gradle.nativeplatform.NativeLibrarySpec

apply plugin: 'cpp'
apply plugin: IccCompilerPlugin
apply plugin: GccCompilerPlugin

void setupToolchain(NativeBinarySpec b) {
def cfg = rootProject.createToolchainConfig(b)
Expand All @@ -27,9 +29,11 @@ model {
}

toolChains {
visualCpp(VisualCpp) {
}
icc(Icc) {
visualCpp(VisualCpp)
if (project.hasProperty("useGcc")) {
gcc(Gcc)
} else {
icc(Icc)
}
}

Expand Down
17 changes: 16 additions & 1 deletion regamedll/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
h.regamedll_tests_src(CppSourceSet) {
source {
Expand Down Expand Up @@ -291,7 +301,12 @@ model {
sources {
RegamedllSrc.regamedll_pch(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) }
Expand Down

0 comments on commit 7aeca16

Please sign in to comment.