Skip to content

Commit a563ace

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.
1 parent 9dd8777 commit a563ace

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

CMakeLists.txt

+9-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ if(POLICY CMP0156)
2222
endif()
2323

2424
if(POLICY CMP0157)
25-
# New Swift build model: improved incremental build performance and LSP support
26-
cmake_policy(SET CMP0157 NEW)
25+
if(CMAKE_SYSTEM_NAME STREQUAL Android)
26+
# CMP0157 causes swift-collections to fail to compile when targetting
27+
# Android on Windows due to swift-driver not being present during the
28+
# toolchain build. Disable it for now.
29+
cmake_policy(SET CMP0157 OLD)
30+
else()
31+
# New Swift build model: improved incremental build performance and LSP support
32+
cmake_policy(SET CMP0157 NEW)
33+
endif()
2734
endif()
2835

2936
if (NOT DEFINED CMAKE_C_COMPILER)

0 commit comments

Comments
 (0)