Skip to content

Commit eacbcae

Browse files
authored
Merge pull request swiftlang#83495 from compnerd/android-cleanup
build.ps1: clean up some android related workarounds
2 parents 36a44a9 + 00f707f commit eacbcae

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

utils/build.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,7 @@ function Build-CMakeProject {
15641564
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_WORKS "YES"
15651565
}
15661566

1567+
# FIXME(compnerd) remove this once the old runtimes build path is removed.
15671568
Add-KeyValueIfNew $Defines SWIFT_ANDROID_NDK_PATH "$AndroidNDKPath"
15681569

15691570
$SWIFTC = if ($UseBuiltCompilers.Contains("Swift")) {
@@ -1611,6 +1612,12 @@ function Build-CMakeProject {
16111612
Add-FlagsDefine $Defines CMAKE_SHARED_LINKER_FLAGS "--ld-path=$ld"
16121613
Add-FlagsDefine $Defines CMAKE_EXE_LINKER_FLAGS "--ld-path=$ld"
16131614
}
1615+
1616+
# TODO(compnerd) we should understand why CMake does not understand
1617+
# that the object file format is ELF when targeting Android on Windows.
1618+
# This indication allows it to understand that it can use `chrpath` to
1619+
# change the RPATH on the dynamic libraries.
1620+
Add-FlagsDefine $Defines CMAKE_EXECUTABLE_FORMAT "ELF"
16141621
}
16151622
}
16161623

@@ -2815,7 +2822,6 @@ function Build-XCTest([Hashtable] $Platform) {
28152822
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
28162823
-Defines @{
28172824
BUILD_SHARED_LIBS = "YES";
2818-
CMAKE_BUILD_WITH_INSTALL_RPATH = "YES";
28192825
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir;
28202826
ENABLE_TESTING = "NO";
28212827
dispatch_DIR = $(Get-ProjectCMakeModules $Platform Dispatch);
@@ -2839,7 +2845,6 @@ function Test-XCTest {
28392845
-SwiftSDK $null `
28402846
-BuildTargets default,check-xctest `
28412847
-Defines @{
2842-
CMAKE_BUILD_WITH_INSTALL_RPATH = "YES";
28432848
CMAKE_Swift_FLAGS = @("-resource-dir", $SwiftRuntimeDirectory, "-vfsoverlay", "${RuntimeBinaryCache}\stdlib\windows-vfs-overlay.yaml");
28442849
ENABLE_TESTING = "YES";
28452850
dispatch_DIR = $(Get-ProjectCMakeModules $BuildPlatform Dispatch);
@@ -2862,7 +2867,6 @@ function Build-Testing([Hashtable] $Platform) {
28622867
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
28632868
-Defines @{
28642869
BUILD_SHARED_LIBS = "YES";
2865-
CMAKE_BUILD_WITH_INSTALL_RPATH = "YES";
28662870
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir;
28672871
dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
28682872
Foundation_DIR = (Get-ProjectCMakeModules $Platform DynamicFoundation);

0 commit comments

Comments
 (0)