Skip to content

Commit

Permalink
[tests] Run hlc tests on windows and mac
Browse files Browse the repository at this point in the history
Using gcc on windows and clang on mac
  • Loading branch information
tobil4sk committed Sep 11, 2024
1 parent 672a88f commit 15cd991
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions tests/runci/targets/Hl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,26 @@ class Hl {
static function buildAndRunHlc(dir:String, filename:String, ?run) {
if (run == null) run = runCommand;

switch (systemName) {
case "Linux" if (isCi()):
runCommand("gcc", [
"-o", '$dir/$filename.exe',
'$dir/$filename.c',
'-I$dir',
'-I$hlInstallDir/include',
'$hlInstallLibDir/fmt.hdll',
'$hlInstallLibDir/ssl.hdll',
'$hlInstallLibDir/sqlite.hdll',
"-lm",
'-L$hlInstallLibDir', "-lhl"
]);

run('$dir/$filename.exe', []);

case _: // TODO hl/c for mac/windows
}
if (!isCi())
return;

final compiler = if (systemName == "Mac") "clang" else "gcc";
final extraCompilerFlags = if (systemName == "Windows") ["-ldbghelp", "-municode"] else [];

runCommand(compiler, [
"-o", '$dir/$filename.exe',
'$dir/$filename.c',
'-I$dir',
'-I$hlInstallDir/include',
'-L$hlInstallLibDir',
'$hlInstallLibDir/fmt.hdll',
'$hlInstallLibDir/ssl.hdll',
'$hlInstallLibDir/sqlite.hdll',
"-lm",
"-lhl"
].concat(extraCompilerFlags));

run('$dir/$filename.exe', []);
}

static function buildAndRun(hxml:String, target:String, ?args:Array<String>) {
Expand Down

0 comments on commit 15cd991

Please sign in to comment.