Skip to content

Commit 88c34b3

Browse files
committed
Set CMP0157 to OLD for Android
There is no early swift-driver build for the Windows toolchain. As a result, libdispatch 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 8c02f89 commit 88c34b3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
21
cmake_minimum_required(VERSION 3.26...3.29)
32

3+
if(POLICY CMP0157)
4+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows AND CMAKE_SYSTEM_NAME STREQUAL Android)
5+
# CMP0157 causes libdispatch to fail to compile when targetting
6+
# Android on Windows due to swift-driver not being present during the
7+
# toolchain build. Disable it for now.
8+
cmake_policy(SET CMP0157 OLD)
9+
else()
10+
# New Swift build model: improved incremental build performance and LSP support
11+
cmake_policy(SET CMP0157 NEW)
12+
endif()
13+
endif()
14+
415
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
516

617
project(dispatch

0 commit comments

Comments
 (0)