3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-25 01:50:33 +00:00

cmake: skip std::atomic link check for Emscripten and single-threaded builds (#9932)

The "Python bindings (Pyodide)" CI job fails at CMake configure time
because Emscripten's cross-compiler cannot pass the `std::atomic` link
tests in `check_link_atomic.cmake`, resulting in a fatal error even
though Pyodide builds are single-threaded and never need `libatomic`.

## Change

- **`cmake/check_link_atomic.cmake`**: guard the entire atomic check
behind `if (NOT (EMSCRIPTEN OR Z3_SINGLE_THREADED))`. Emscripten sets
`EMSCRIPTEN` automatically via `emcmake`; Pyodide builds also pass
`-DZ3_SINGLE_THREADED=TRUE`, so either condition is sufficient to bypass
the check safely.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot 2026-06-23 14:05:02 -06:00 committed by GitHub
parent cb3fe3167f
commit 2081918cea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,8 @@
if (EMSCRIPTEN OR Z3_SINGLE_THREADED)
# Emscripten (Pyodide/WASM) and single-threaded builds do not use
# libatomic; skip the check to avoid a spurious configure failure.
message(STATUS "Skipping std::atomic link check (EMSCRIPTEN or Z3_SINGLE_THREADED)")
else()
set(ATOMIC_TEST_SOURCE "
#include <atomic>
std::atomic<int> x;
@ -21,3 +26,4 @@ if (NOT BUILTIN_ATOMIC)
message(FATAL_ERROR "Host compiler must support std::atomic!")
endif()
endif()
endif()