|
| 1 | + |
| 2 | +add_subdirectory(cxxshim) |
| 3 | +if(LINUX) |
| 4 | + add_ubdirectory(libstdcxx) |
| 5 | +endif() |
| 6 | +add_subdirectory(std) |
| 7 | + |
| 8 | +add_library(swiftCxx STATIC |
| 9 | + CxxConvertibleToBool.swift |
| 10 | + CxxConvertibleToCollection.swift |
| 11 | + CxxDictionary.swift |
| 12 | + CxxOptional.swift |
| 13 | + CxxPair.swift |
| 14 | + CxxRandomAccessCollection.swift |
| 15 | + CxxSequence.swift |
| 16 | + CxxSet.swift |
| 17 | + CxxSpan.swift |
| 18 | + CxxVector.swift |
| 19 | + UnsafeCxxIterators.swift) |
| 20 | +set_target_properties(swiftCxx PROPERTIES |
| 21 | + Swift_MODULE_NAME Cxx) |
| 22 | +target_compile_options(swiftCxx PRIVATE |
| 23 | + "-strict-memory-safety" |
| 24 | + "-cxx-interoperability-mode=default" |
| 25 | + "-warn-implicit-overrides" |
| 26 | + "SHELL:-Xfrontend -enable-lexical-lifetimes=false" |
| 27 | + "SHELL:-Xfrontend -enable-ossa-modules" |
| 28 | + # This module should not pull in the C++ standard library, so we disable it |
| 29 | + # explicitly. For functionality that depends on the C++ stdlib, use C++ |
| 30 | + # stdlib overlay (`swiftstd` module). |
| 31 | + "SHELL:-Xcc -nostdinc++" |
| 32 | + "SHELL:-enable-experimental-feature AllowUnsafeAttribute" |
| 33 | + "SHELL:-enable-experimental-feature BuiltinModule" |
| 34 | + "SHELL:-enable-experimental-feature InoutLifetimeDependence" |
| 35 | + "SHELL:-enable-experimental-feature LifetimeDependence" |
| 36 | + "SHELL:-enable-experimental-feature LifetimeDependenceMutableAccessors" |
| 37 | + "SHELL:-enable-experimental-feature MemberImportVisibility" |
| 38 | + "SHELL:-enable-experimental-feature NoncopyableGenerics2" |
| 39 | + "SHELL:-enable-experimental-feature NonescapableTypes" |
| 40 | + "SHELL:-enable-experimental-feature Span" |
| 41 | + "SHELL:-enable-experimental-feature SE427NoInferenceOnExtension" |
| 42 | + "SHELL:-enable-experimental-feature SuppressedAssociatedTypes") |
| 43 | +target_link_libraries(swiftCxx PRIVATE |
| 44 | + swiftCore) |
| 45 | + |
| 46 | +install(TARGETS swiftCxx |
| 47 | + EXPORT SwiftOverlayTargets |
| 48 | + ARCHIVE DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}" |
| 49 | + LIBRARY DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}" |
| 50 | + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") |
| 51 | +emit_swift_interface(swiftCxx) |
| 52 | +install_swift_interface(swiftCxx) |
| 53 | + |
| 54 | +embed_manifest(swiftCxx) |
0 commit comments