-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
51 lines (39 loc) · 1.2 KB
/
build.gradle
File metadata and controls
51 lines (39 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
plugins {
id 'base'
}
def buildDir = layout.projectDirectory.dir("build-gradle")
def cmakeBuildDir = buildDir.dir("cmake")
task cmakeConfigure(type: Exec) {
group = "build"
description = "Configure the project with CMake"
mkdir(cmakeBuildDir)
workingDir cmakeBuildDir
commandLine "cmake", "../..",
"-DCMAKE_BUILD_TYPE=Release",
"-DUSE_ONNX_RUNTIME=OFF",
"-DUSE_TENSORRT=ON",
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
"-DCMAKE_C_COMPILER=clang-15",
"-DCMAKE_CXX_COMPILER=clang++-15"
// Using Clang as recommended in the README
}
task cmakeBuild(type: Exec) {
group = "build"
description = "Build the project with CMake"
dependsOn cmakeConfigure
workingDir cmakeBuildDir
commandLine "cmake", "--build", ".", "--parallel"
}
task runTests(type: Exec) {
group = "verification"
description = "Run project tests"
dependsOn cmakeBuild
workingDir cmakeBuildDir
commandLine "ctest", "--output-on-failure"
}
// Map standard Gradle tasks to CMake tasks
build.dependsOn cmakeBuild
check.dependsOn runTests
clean.doFirst {
delete buildDir
}