From bf37f358a01c8d04c0e693b7d132d7ab2ddb801f Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 30 Nov 2022 18:13:44 -0800 Subject: [PATCH] build: disable bytecode layout library without stdlib This directory is directly added from the top-level CMake which bypasses the compiler swapping dance. When cross-compiling or building the toolchain with a non-clang compiler, the forced flags for the standard library directory will result in build failures. Avoid building the library unless the standard library is being built (which will require that the compiler-swap occurs). --- stdlib/toolchain/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/toolchain/CMakeLists.txt b/stdlib/toolchain/CMakeLists.txt index dfdb58a1ea0f4..0dbc1c4f76eb9 100644 --- a/stdlib/toolchain/CMakeLists.txt +++ b/stdlib/toolchain/CMakeLists.txt @@ -46,7 +46,9 @@ endif() # runtime being patched only through public ABI. list(APPEND CXX_COMPILE_FLAGS "-DSWIFT_COMPATIBILITY_LIBRARY=1") -add_subdirectory(CompatibilityBytecodeLayouts) +if(SWIFT_BUILD_STDLIB) + add_subdirectory(CompatibilityBytecodeLayouts) +endif() if(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT) add_subdirectory(legacy_layouts)