File: dont_run_cmakeBuild_twice.patch

package info (click to toggle)
gkl 0.9.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,192 kB
  • sloc: ansic: 57,712; asm: 39,350; cpp: 6,101; java: 2,639; sh: 1,866; makefile: 887; pascal: 317; xml: 106; perl: 104
file content (26 lines) | stat: -rw-r--r-- 870 bytes parent folder | download
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
Description: the CMake build task should be run only once.
 Yet it would be called twice when we run the build and then the tests. We add
 a check to prevent such situation.
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2021-12-24

--- a/build.gradle
+++ b/build.gradle
@@ -44,12 +44,13 @@
 }
 
 task cmakeBuild(type: Exec) {
+    def soCompression = file("$nativeBuildDir/libgkl_compression.so")
     // hide stdout, but print stderr
     standardOutput = new ByteArrayOutputStream()
     workingDir nativeBuildDir
-    commandLine 'make', 'install', '-j', Runtime.runtime.availableProcessors()
-    // always run this task
-    outputs.upToDateWhen {false}
+    //Run only if we never executed copyNativeLib.
+    if (!soCompression.exists()) commandLine 'make', 'install'
+    else commandLine 'true'
 }
 
 task copyNativeLib(type: Copy) {