From 6781b8d688007af9e4b2bd9d59ea660ccd77e84c Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Wed, 14 Aug 2024 10:57:34 -0700 Subject: [PATCH 1/2] [android] don't enable WMO as the old driver fails to build with WMO on windows --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3243e5398..d7cc95eac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,8 @@ if(NOT SWIFT_SYSTEM_NAME) endif() # Don't enable WMO on Windows due to linker failures -if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) +# Don't enable WMO on Android as swift's old driver has a bug with using it. +if((NOT CMAKE_SYSTEM_NAME STREQUAL Windows) AND (NOT CMAKE_SYSTEM_NAME STREQUAL Android)) # Enable whole module optimization for release builds & incremental for debug builds if(POLICY CMP0157) set(CMAKE_Swift_COMPILATION_MODE "$,wholemodule,incremental>") From c74ac98d99494f15dd6b59a355d2809653405da6 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Wed, 14 Aug 2024 14:11:49 -0700 Subject: [PATCH 2/2] Switch to host system name check --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7cc95eac..0cb6c886e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,9 +35,9 @@ if(NOT SWIFT_SYSTEM_NAME) endif() endif() -# Don't enable WMO on Windows due to linker failures -# Don't enable WMO on Android as swift's old driver has a bug with using it. -if((NOT CMAKE_SYSTEM_NAME STREQUAL Windows) AND (NOT CMAKE_SYSTEM_NAME STREQUAL Android)) +# Don't enable WMO on Windows hosts due to linker failures, and the use of swift's +# old driver from build.ps1 when building for windows/android on a windows host. +if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) # Enable whole module optimization for release builds & incremental for debug builds if(POLICY CMP0157) set(CMAKE_Swift_COMPILATION_MODE "$,wholemodule,incremental>")