|
| 1 | + |
| 2 | +add_library(swiftCxxStdlib STATIC |
| 3 | + std.swift |
| 4 | + Chrono.swift |
| 5 | + String.swift) |
| 6 | +set_target_properties(swiftCxxStdlib PROPERTIES |
| 7 | + Swift_MODULE_NAME CxxStdlib) |
| 8 | +target_compile_options(swiftCxxStdlib PRIVATE |
| 9 | + "-strict-memory-safety" |
| 10 | + "-cxx-interoperability-mode=default" |
| 11 | + "SHELL:-enable-experimental-feature AllowUnsafeAttribute" |
| 12 | + # This flag is unnecessary when building with newer compilers that allow using |
| 13 | + # C++ symbols in resilient overlays (see f4204568). |
| 14 | + "SHELL:-enable-experimental-feature AssumeResilientCxxTypes" |
| 15 | + # The varying modularization of the C++ standard library on different |
| 16 | + # platforms makes it difficult to enable MemberImportVisibility for this |
| 17 | + # module |
| 18 | + "SHELL:-disable-upcoming-feature MemberImportVisibility" |
| 19 | + "SHELL:-Xfrontend -module-interface-preserve-types-as-written") |
| 20 | +target_link_libraries(swiftCxxStdlib PRIVATE |
| 21 | + cxxshim |
| 22 | + swift_Builtin_float |
| 23 | + $<$<PLATFORM_ID:Android>:swiftAndroid>) |
| 24 | +target_link_libraries(swiftCxxStdlib PRIVATE |
| 25 | + $<$<PLATFORM_ID:Linux>:libstdcxx) |
| 26 | + |
| 27 | +install(TARGETS swiftCxxStdlib |
| 28 | + EXPORT SwiftOverlayTargets |
| 29 | + ARCHIVE DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}" |
| 30 | + LIBRARY DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}" |
| 31 | + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") |
| 32 | +emit_swift_interface(swiftCxxStdlib) |
| 33 | +install_swift_interface(swiftCxxStdlib) |
| 34 | + |
| 35 | +embed_manifest(swiftCxxStdlib) |
0 commit comments