Add clang64 MinGW environment to CI

run-test262 required pthreads, so let's add that. In addition, in MinGW,
clock_gettime is implemented in the pthreads library, so we want to link
it too.

This doesn't get us anywhere closer to building with ClangCL on Windows,
but hey, another target that required some tweaking...
This commit is contained in:
Saúl Ibarra Corretgé 2023-11-27 10:00:42 +01:00
parent 0b920e7411
commit 00d104e519
3 changed files with 7 additions and 3 deletions

View file

@ -228,6 +228,7 @@ jobs:
sys:
- mingw32
- mingw64
- clang64
- ucrt64
defaults:
run:

View file

@ -131,8 +131,11 @@ if(BUILD_QJS_LIBC)
endif()
list(APPEND qjs_defines _GNU_SOURCE)
list(APPEND qjs_libs qjs m)
if(NOT MINGW)
list(APPEND qjs_libs dl pthread)
if(NOT WIN32)
list(APPEND qjs_libs dl)
endif()
if(NOT MSVC)
list(APPEND qjs_libs pthread)
endif()
add_library(qjs ${qjs_sources})

2
qjs.c
View file

@ -144,7 +144,7 @@ static inline size_t js_trace_malloc_usable_size(void *ptr)
}
static void
#ifdef _WIN32
#if defined(_WIN32) && !defined(__clang__)
/* mingw printf is used */
__attribute__((format(gnu_printf, 2, 3)))
#else