Skip to content

Commit

Permalink
[ci] Use cmake install for installing hashlink
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Sep 11, 2024
1 parent 0866067 commit da223b7
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions tests/runci/targets/Hl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
Expand Down Expand Up @@ -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/');
}
Expand All @@ -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', []);
Expand Down

0 comments on commit da223b7

Please sign in to comment.