Skip to content

Commit 6f4a14a

Browse files
committed
Set CMP0157 to OLD for Android
There is no early swift-driver build for the Windows toolchain. As a result, swift-collections fails to build properly when CMP0157 is set to NEW due to object files not being generated. This sets CMP0157 to OLD when targetting Android until the early swift-driver is available on Windows. This is similar to swiftlang/swift-corelibs-foundation#5180
1 parent af6b5b9 commit 6f4a14a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@
99
cmake_minimum_required(VERSION 3.19.6...3.29)
1010

1111
if(POLICY CMP0157)
12-
cmake_policy(SET CMP0157 NEW)
12+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows AND CMAKE_SYSTEM_NAME STREQUAL Android)
13+
# CMP0157 causes swift-testing to fail to compile when targetting
14+
# Android on Windows due to swift-driver not being present during the
15+
# toolchain build. Disable it for now.
16+
cmake_policy(SET CMP0157 OLD)
17+
else()
18+
# New Swift build model: improved incremental build performance and LSP support
19+
cmake_policy(SET CMP0157 NEW)
20+
endif()
1321
endif()
1422

1523
project(SwiftTesting

0 commit comments

Comments
 (0)