32 lines
1.1 KiB
Groovy
32 lines
1.1 KiB
Groovy
plugins {
|
|||
|
|
id 'cpp-library'
|
||
|
|
id 'cpp-unit-test'
|
||
|
|
}
|
||
|
|
apply from: rootProject.file('gradle/common.gradle')
|
||
|
|
|
||
|
|
library {
|
||
|
|
baseName = 'CosmicEngine'
|
||
|
|
linkage = [Linkage.SHARED]
|
||
|
|
targetMachines.add(machines.windows.x86_64)
|
||
|
|
targetMachines.add(machines.linux.x86_64)
|
||
|
|
source.from('src/main')
|
||
|
|
publicHeaders.from('src/main') // visibles par App et Scripts
|
||
|
|
}
|
||
|
|
|
||
|
|
// Seul le moteur lie les libs vcpkg (SDL, Jolt, assimp...).
|
||
|
|
tasks.withType(AbstractLinkTask).configureEach {
|
||
|
|
dependsOn ':vcpkg'
|
||
|
|
linkerArgs.addAll("-L${rootProject.ext.vcpkgLibDir}", "@${rootProject.ext.vcpkgRsp}")
|
||
|
|
if (!org.gradle.internal.os.OperatingSystem.current().isWindows()) {
|
||
|
|
linkerArgs.add('-lopenal')
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Pour les tests
|
||
|
|
tasks.withType(RunTestExecutable).configureEach {
|
||
|
|
args("--gtest_color=yes")
|
||
|
|
args("--gtest_output=xml:report.xml")
|
||
|
|
// Les DLL/SO vcpkg doivent être trouvables à l'exécution des tests.
|
||
|
|
def pathVar = org.gradle.internal.os.OperatingSystem.current().isWindows() ? 'PATH' : 'LD_LIBRARY_PATH'
|
||
|
|
environment pathVar, rootProject.ext.runtimeDir.absolutePath + File.pathSeparator + (System.getenv(pathVar) ?: '')
|
||
|
|
}
|