Skip to content

Commit a541965

Browse files
cmake: Fix unexpected CMake variable expansion for "WASI"
CMake 3.31 introduced a new variable `WASI` that conflicts with the sdk name in `SWIFT_SDKS` CMake variable in our build system. With CMake 3.31 and later, tests of `--build-wasm-stdlib` fail because `if(${SDK} STREQUAL "WASI")` always evaluates to false. https://cmake.org/cmake/help/v3.31/variable/WASI.html
1 parent db7bd86 commit a541965

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ foreach(SDK ${SWIFT_SDKS})
407407
# Reset these values for WASI, as Embedded Swift for WASI requires separate lit configs.
408408
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_old ${SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB})
409409
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING_old ${SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING})
410-
if(${SDK} STREQUAL "WASI")
410+
if("${SDK}" STREQUAL "WASI")
411411
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB OFF)
412412
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING OFF)
413413
endif()

0 commit comments

Comments
 (0)