Skip to content

Commit a294509

Browse files
committed
Windows: Pass full triple to Swift
`CMAKE_Swift_COMPILER_TARGET` takes the full target triple, not the module triple. This probably doesn't affect Windows, but will/does affect availability on Android resulting in Foundation failing to build due to `error: 'getgrnam_r' is only available in Android 24 or newer`.
1 parent 16ce6b8 commit a294509

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ function Build-CMakeProject {
16621662
}
16631663

16641664
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER $SWIFTC
1665-
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_TARGET (Get-ModuleTriple $Platform)
1665+
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_TARGET $Platform.Triple
16661666

16671667
# TODO(compnerd): remove this once we have the early swift-driver
16681668
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_USE_OLD_DRIVER "YES"
@@ -1793,7 +1793,7 @@ function Build-CMakeProject {
17931793
Join-Path -Path (Get-PinnedToolchainToolsDir) -ChildPath "swiftc.exe"
17941794
}
17951795
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER $SWIFTC
1796-
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_TARGET (Get-ModuleTriple $Platform)
1796+
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_TARGET $Platform.Triple
17971797

17981798
# TODO(compnerd) remove this once we have the early swift-driver
17991799
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_USE_OLD_DRIVER "YES"
@@ -2947,7 +2947,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
29472947
-Defines @{
29482948
BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
29492949
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
2950-
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform);
2950+
CMAKE_Swift_COMPILER_TARGET = $Platform.Triple;
29512951
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
29522952

29532953
SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";

0 commit comments

Comments
 (0)