From 00d104e51939d07367dd57a89c1522aba6cc6dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 27 Nov 2023 10:00:42 +0100 Subject: [PATCH] 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... --- .github/workflows/ci.yml | 1 + CMakeLists.txt | 7 +++++-- qjs.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41e58d9..d164fb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,6 +228,7 @@ jobs: sys: - mingw32 - mingw64 + - clang64 - ucrt64 defaults: run: diff --git a/CMakeLists.txt b/CMakeLists.txt index 1562eba..d1baf64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/qjs.c b/qjs.c index 5c52368..2912d1a 100644 --- a/qjs.c +++ b/qjs.c @@ -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