Skip to content

Commit bf37f35

Browse files
committed
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).
1 parent d9c4bed commit bf37f35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/toolchain/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ endif()
4646
# runtime being patched only through public ABI.
4747
list(APPEND CXX_COMPILE_FLAGS "-DSWIFT_COMPATIBILITY_LIBRARY=1")
4848

49-
add_subdirectory(CompatibilityBytecodeLayouts)
49+
if(SWIFT_BUILD_STDLIB)
50+
add_subdirectory(CompatibilityBytecodeLayouts)
51+
endif()
5052

5153
if(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT)
5254
add_subdirectory(legacy_layouts)

0 commit comments

Comments
 (0)