From 2081918cea27e604b9077a6c36acb2ac28aa5b78 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Jun 2026 14:05:02 -0600 Subject: [PATCH] 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> --- cmake/check_link_atomic.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/check_link_atomic.cmake b/cmake/check_link_atomic.cmake index d462191a0..aef5cd63f 100644 --- a/cmake/check_link_atomic.cmake +++ b/cmake/check_link_atomic.cmake @@ -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 std::atomic x; @@ -21,3 +26,4 @@ if (NOT BUILTIN_ATOMIC) message(FATAL_ERROR "Host compiler must support std::atomic!") endif() endif() +endif()