Skip to content

Commit 4e79766

Browse files
committed
swiftMSVCRT: build with -Xcc -D_USE_MATH_DEFINES
This enables the use of the math defines when building tgmath.swift. Although not used in the normal branch, this define is necessary to build the swiftMSVCRT module for TensorFlow which uses the math constants.
1 parent 85eb293 commit 4e79766

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

stdlib/public/Platform/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ add_swift_target_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_
2222
${swift_platform_gyb_sources}
2323
Darwin.swift.gyb
2424

25-
SWIFT_COMPILE_FLAGS -Xfrontend -disable-objc-attr-requires-foundation-module ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
25+
SWIFT_COMPILE_FLAGS
26+
${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
27+
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
28+
-Xfrontend -disable-objc-attr-requires-foundation-module
2629
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
2730
TARGET_SDKS ALL_APPLE_PLATFORMS
2831
INSTALL_IN_COMPONENT sdk-overlay
@@ -37,7 +40,9 @@ add_swift_target_library(swiftGlibc ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_O
3740
${swift_platform_gyb_sources}
3841
Glibc.swift.gyb
3942

40-
SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
43+
SWIFT_COMPILE_FLAGS
44+
${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
45+
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
4146
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
4247
TARGET_SDKS ANDROID CYGWIN FREEBSD LINUX HAIKU
4348
INSTALL_IN_COMPONENT sdk-overlay
@@ -51,7 +56,10 @@ add_swift_target_library(swiftMSVCRT ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_
5156
GYB_SOURCES
5257
${swift_platform_gyb_sources}
5358

54-
SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
59+
SWIFT_COMPILE_FLAGS
60+
${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
61+
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
62+
-Xcc -D_USE_MATH_DEFINES
5563
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
5664
TARGET_SDKS WINDOWS
5765
INSTALL_IN_COMPONENT sdk-overlay)

0 commit comments

Comments
 (0)