Skip to content

Commit db6474a

Browse files
Merge pull request #5180 from Steelskin/fabrice/disable-cmp0157-android
Set CMP0157 to OLD for Android on when building with the Windows toolchain
2 parents 853b681 + 01576d7 commit db6474a

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_HOST_SYSTEM_NAME STREQUAL Windows AND 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)