Skip to content

Commit 817a890

Browse files
committed
CMake Android: ensure _Builtin_float is built before _math
_math would be able to build against either the Swift or the clang module for _Builtin_float; however the build will fail if the Swift module is present but does not contain the architectures we need, with errors like ``` <unknown>:0: error: could not find module '_Builtin_float' for target 'armv7-unknown-linux-android'; found: aarch64-unknown-linux-android, x86_64-unknown-linux-android, at: /home/build-user/build/swift-project/Ninja-Release/swift-linux-x86_64/lib/swift/android/_Builtin_float.swiftmodule/armv7-unknown-linux-android ``` In other words, in this situation we are not falling back to the clang module. Addresses rdar://165768601
1 parent 4ad6bea commit 817a890

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Runtimes/Overlay/Android/Math/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ set_target_properties(swift_math PROPERTIES
55
Swift_MODULE_NAME _math)
66
target_link_libraries(swift_math PRIVATE
77
SwiftAndroid
8-
swiftCore)
8+
swiftCore
9+
swift_Builtin_float)
910

1011
install(TARGETS swift_math
1112
EXPORT SwiftOverlayTargets

stdlib/public/Platform/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ add_swift_target_library(swift_math ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_O
167167
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
168168
TARGET_SDKS "ANDROID"
169169
INSTALL_IN_COMPONENT sdk-overlay
170+
SWIFT_MODULE_DEPENDS_ANDROID _Builtin_float
170171
DEPENDS android_modulemap)
171172

172173
add_swift_target_library(swiftAndroid ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY

0 commit comments

Comments
 (0)