diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b337b55ac..81c6f6c74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: clang_version: 15.0.7 llvm_asset_suffix: arm64-apple-darwin22.0 upload: macos-clang-15 - args: -DBUILD_SHARED=OFF -DCMAKE_C_COMPILER_WORKS=ON + args: -DBUILD_SHARED=OFF - name: Build on Windows x86_64 os: windows-2025 clang_version: 20.1.8 diff --git a/CMakeLists.txt b/CMakeLists.txt index 3da53accd..be705d140 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,11 @@ endif() # Force a cross-compile to WASI at all times. set(CMAKE_SYSTEM_NAME WASI) +# Skip the compiler check. +# We usually don't set CMAKE_C_COMPILER_TARGET correctly. Even if we do, +# the check requires more than what we actually require. (eg. crt objects) +set(CMAKE_C_COMPILER_WORKS 1) + # I'm not entirely sure why this is necessary on Windows. This may be a bug in # CMake, I'm not sure. The problem is that, at least on CI, CMake detects that # the compiler in use is clang but doesn't understand the `SYSTEM` header