From ffef0c8bf66471d51d4d11dc0b934224360ea63d Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 11 Sep 2024 14:53:54 +0100 Subject: [PATCH] [tests] Run hlc tests on windows and mac Using gcc on windows and clang on mac --- tests/runci/targets/Hl.hx | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/tests/runci/targets/Hl.hx b/tests/runci/targets/Hl.hx index cf867237ccb..2d5a38c33ec 100644 --- a/tests/runci/targets/Hl.hx +++ b/tests/runci/targets/Hl.hx @@ -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', + '-l:fmt.hdll', + '-l:ssl.hdll', + '-l:sqlite.hdll', + "-lm", + "-lhl" + ].concat(extraCompilerFlags)); + + run('$dir/$filename.exe', []); } static function buildAndRun(hxml:String, target:String, ?args:Array) {