Skip to content

Commit 7709bda

Browse files
committed
[android] build libxml2 and curl with -fPIC
Sets `CMAKE_POSITION_INDEPENDENT_CODE=YES` when building libxml2 and curl. This causes `-fPIC` to be passed to clang when compiling, which is required for the i686 Android build to succeed. This change makes `build.ps1` consistent with the Python build files swift_build_support\products\libxml2.py and swift_build_support\products\curl.py, which already define this cmake property. It is already propertly set for zlib in both locations.
1 parent 736faac commit 7709bda

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

utils/build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,7 @@ function Build-XML2([Platform]$Platform, $Arch) {
15021502
BUILD_SHARED_LIBS = "NO";
15031503
CMAKE_INSTALL_BINDIR = "bin/$Platform/$ArchName";
15041504
CMAKE_INSTALL_LIBDIR = "lib/$Platform/$ArchName";
1505+
CMAKE_POSITION_INDEPENDENT_CODE = "YES";
15051506
CMAKE_SYSTEM_NAME = $Platform.ToString();
15061507
LIBXML2_WITH_ICONV = "NO";
15071508
LIBXML2_WITH_ICU = "NO";
@@ -1568,6 +1569,7 @@ function Build-CURL([Platform]$Platform, $Arch) {
15681569
BUILD_SHARED_LIBS = "NO";
15691570
BUILD_TESTING = "NO";
15701571
CMAKE_INSTALL_LIBDIR = "lib/$Platform/$ArchName";
1572+
CMAKE_POSITION_INDEPENDENT_CODE = "YES";
15711573
CMAKE_SYSTEM_NAME = $Platform.ToString();
15721574
BUILD_CURL_EXE = "NO";
15731575
BUILD_LIBCURL_DOCS = "NO";

0 commit comments

Comments
 (0)