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:
parent
cb3fe3167f
commit
2081918cea
1 changed files with 6 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue