From da223b7ad488d32cd155fe79c321a6cce27e9ba6 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 11 Sep 2024 12:06:49 +0100 Subject: [PATCH] [ci] Use cmake install for installing hashlink --- tests/runci/targets/Hl.hx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/runci/targets/Hl.hx b/tests/runci/targets/Hl.hx index 07ff7999687..0019e856d9d 100644 --- a/tests/runci/targets/Hl.hx +++ b/tests/runci/targets/Hl.hx @@ -10,13 +10,15 @@ using StringTools; class Hl { static final hlSrc = Path.join([getDownloadPath(), "hashlink"]); - static final hlBuild = Path.join([getInstallPath(), "hashlink_build"]); + static final hlBuild = Path.join([getDownloadPath(), "hashlink_build"]); - static final hlBuildBinDir = Path.join([getInstallPath(), "hashlink_build", "bin"]); + static final hlInstallDir = Path.join([getInstallPath(), "hashlink"]); + static final hlInstallBinDir = if (systemName == "Windows") hlInstallDir else Path.join([hlInstallDir, "bin"]); + static final hlInstallLibDir = if (systemName == "Windows") hlInstallDir else Path.join([hlInstallDir, "lib"]); static final hlBinary = if (isCi() || !commandSucceed("hl", ["--version"])){ - Path.join([hlBuildBinDir, "hl"]) + ((systemName == "Windows") ? ".exe" : ""); + Path.join([hlInstallBinDir, "hl"]) + ((systemName == "Windows") ? ".exe" : ""); } else { commandResult(if(systemName == "Windows") "where" else "which", ["hl"]).stdout.trim(); }; @@ -56,16 +58,18 @@ class Hl { "-DWITH_UI=OFF", "-DWITH_UV=OFF", "-DWITH_VIDEO=OFF", + "-DCMAKE_INSTALL_PREFIX=" + hlInstallDir, "-B" + hlBuild, "-H" + hlSrc ])); runCommand("cmake", [ "--build", hlBuild ]); + runCommand("cmake", ["--build", hlBuild, "--target", "install"]); runCommand(hlBinary, ["--version"]); - addToPATH(hlBuildBinDir); - addToLIBPATH(hlBuildBinDir); + addToPATH(hlInstallBinDir); + addToLIBPATH(hlInstallLibDir); haxelibDev("hashlink", '$hlSrc/other/haxelib/'); } @@ -79,12 +83,12 @@ class Hl { "-o", '$dir/$filename.exe', '$dir/$filename.c', '-I$dir', - '-I$hlSrc/src', - '$hlBuildBinDir/fmt.hdll', - '$hlBuildBinDir/ssl.hdll', - '$hlBuildBinDir/sqlite.hdll', + '-I$hlInstallDir/include', + '$hlInstallLibDir/fmt.hdll', + '$hlInstallLibDir/ssl.hdll', + '$hlInstallLibDir/sqlite.hdll', "-lm", - '-L$hlBuildBinDir', "-lhl" + '-L$hlInstallLibDir', "-lhl" ]); run('$dir/$filename.exe', []);