File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,20 @@ add_custom_target(musl_modulemap DEPENDS ${musl_modulemap_target_list})
273
273
set_property (TARGET musl_modulemap PROPERTY FOLDER "Miscellaneous" )
274
274
add_dependencies (sdk-overlay musl_modulemap )
275
275
276
+ # Add a system 'math' module overlay, that only applies only to platforms that
277
+ # have a top level '_math' module.
278
+ add_swift_target_library (swift_math ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
279
+ Math .swift
280
+
281
+ SWIFT_COMPILE_FLAGS
282
+ ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
283
+ ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
284
+ ${swift_platform_compile_flags}
285
+ LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS} "
286
+ TARGET_SDKS "ANDROID"
287
+ INSTALL_IN_COMPONENT sdk-overlay
288
+ DEPENDS android_modulemap )
289
+
276
290
add_swift_target_library (swiftAndroid ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
277
291
Android.swift
278
292
${swift_platform_sources}
Original file line number Diff line number Diff line change
1
+ @_exported import _math
2
+
3
+ // Constants defined by <math.h>
4
+ @available ( swift, deprecated: 3.0 , message: " Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting. " )
5
+ public let M_PI = Double . pi
6
+
7
+ @available ( swift, deprecated: 3.0 , message: " Please use 'Double.pi / 2' or '.pi / 2' to get the value of correct type and avoid casting. " )
8
+ public let M_PI_2 = Double . pi / 2
9
+
10
+ @available ( swift, deprecated: 3.0 , message: " Please use 'Double.pi / 4' or '.pi / 4' to get the value of correct type and avoid casting. " )
11
+ public let M_PI_4 = Double . pi / 4
12
+
13
+ @available ( swift, deprecated: 3.0 , message: " Please use '2.squareRoot()'. " )
14
+ public let M_SQRT2 = 2 . squareRoot ( )
15
+
16
+ @available ( swift, deprecated: 3.0 , message: " Please use '0.5.squareRoot()'. " )
17
+ public let M_SQRT1_2 = 0.5 . squareRoot ( )
You can’t perform that action at this time.
0 commit comments