Skip to content

Commit 4b11917

Browse files
committed
build: don't link C++ runtime on android
1 parent b7c12c2 commit 4b11917

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
109109
set(WORKAROUND_SR9138 -Xlinker;-ignore:4049;-Xlinker;-ignore:4217)
110110
endif()
111111

112+
if(CMAKE_SYSTEM_NAME STREQUAL Android)
113+
set(WORKAROUND_PR26110 -Xclang-linker -nostdlib++)
114+
endif()
115+
112116
# NOTE(compnerd) this is a horrible hack to work around the fact that we do not
113117
# have a proper library target for Foundation which can link against the
114118
# CoreFoundation target. When we gain proper CMake support for Swift, we should
@@ -284,6 +288,7 @@ add_swift_library(Foundation
284288
$<$<PLATFORM_ID:Windows>:-lShell32>
285289
$<$<PLATFORM_ID:Windows>:-lpathcch>
286290
$<$<PLATFORM_ID:Windows>:$<TARGET_OBJECTS:CoreFoundationResources>>
291+
${WORKAROUND_PR26110}
287292
SWIFT_FLAGS
288293
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
289294
-DDEPLOYMENT_RUNTIME_SWIFT
@@ -348,6 +353,7 @@ add_swift_library(FoundationNetworking
348353
${Foundation_RPATH}
349354
${WORKAROUND_SR9138}
350355
${WORKAROUND_SR9995}
356+
${WORKAROUND_PR26110}
351357
SWIFT_FLAGS
352358
-DDEPLOYMENT_RUNTIME_SWIFT
353359
-DNS_BUILDING_FOUNDATION_NETWORKING

0 commit comments

Comments
 (0)