diff --git a/cmake/wasi-sdk-sysroot.cmake b/cmake/wasi-sdk-sysroot.cmake index 91aaaf1..c1837c9 100644 --- a/cmake/wasi-sdk-sysroot.cmake +++ b/cmake/wasi-sdk-sysroot.cmake @@ -148,10 +148,11 @@ function(define_wasi_libc_sub target target_suffix lto) set(extra_make_flags default) # If LTO is enabled then pass that on to wasi-libc, and otherwise make sure to - # build a `libc.so` dynamic library. + # build a `libc.so` dynamic library where possible (not compatible with + # threads though) if(lto) list(APPEND extra_make_flags LTO=full) - else() + elseif(NOT ${target} MATCHES threads) list(APPEND extra_make_flags libc_so) endif()