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
@@ -45,12 +45,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'
-    // 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) {
