Initial commit - Migration from cmake to gradle
This commit is contained in:
commit
279f292225
217 files changed
+14945
No files matched your search
@@ -0,0 +1,32 @@
|
||||
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) ?: '')
|
||||
}
|
||||
Reference in new issue
Block a user