|
| 1 | +add_library(swiftSwiftOnoneSupport |
| 2 | + SwiftOnoneSupport.swift |
| 3 | + "${PROJECT_SOURCE_DIR}/linker-support/magic-symbols-for-install-name.c") |
| 4 | + |
| 5 | +set_target_properties(swiftSwiftOnoneSupport PROPERTIES |
| 6 | + Swift_MODULE_NAME SwiftOnoneSupport) |
| 7 | + |
| 8 | +if(APPLE AND BUILD_SHARED_LIBS) |
| 9 | + target_link_options(swiftSwiftOnoneSupport PRIVATE "SHELL:-Xlinker -headerpad_max_install_names") |
| 10 | +endif() |
| 11 | + |
| 12 | +target_compile_options(swiftSwiftOnoneSupport PRIVATE |
| 13 | + $<$<COMPILE_LANGUAGE:Swift>:-parse-stdlib> |
| 14 | + "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xllvm -sil-inline-generics=false>" |
| 15 | + |
| 16 | + # We have to disable validation of TBD files, because this module is |
| 17 | + # _explicitly_ special-cased to result in extra symbols generated by the |
| 18 | + # optimizer, meaning TBDGen can't (and shouldn't: it has to run |
| 19 | + # pre-optimization for performance) list them. |
| 20 | + # See also caa3dd4d291ec93c1a59f1db62604e703bff8468 |
| 21 | + "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -validate-tbd-against-ir=none>" |
| 22 | + |
| 23 | + "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -check-onone-completeness>" |
| 24 | + "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-access-control>") |
| 25 | + |
| 26 | +target_compile_definitions(swiftSwiftOnoneSupport PRIVATE |
| 27 | + $<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_TARGET_LIBRARY_NAME=swiftSwiftOnoneSupport>) |
| 28 | + |
| 29 | +target_link_libraries(swiftSwiftOnoneSupport |
| 30 | + PRIVATE |
| 31 | + swiftShims |
| 32 | + swiftCore) |
| 33 | + |
| 34 | +install(TARGETS swiftSwiftOnoneSupport |
| 35 | + ARCHIVE DESTINATION "${SwiftCore_INSTALL_LIBDIR}" |
| 36 | + LIBRARY DESTINATION "${SwiftCore_INSTALL_LIBDIR}" |
| 37 | + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") |
| 38 | +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SwiftOnoneSupport.swiftmodule" |
| 39 | + DESTINATION "${SwiftCore_INSTALL_SWIFTMODULEDIR}/SwiftOnoneSupport.swiftmodule" |
| 40 | + RENAME "${SwiftCore_MODULE_TRIPLE}.swiftmodule") |
| 41 | +emit_swift_interface(swiftSwiftOnoneSupport) |
| 42 | +install_swift_interface(swiftSwiftOnoneSupport) |
| 43 | + |
| 44 | +# Configure plist creation for Darwin platforms. |
| 45 | +generate_plist("${CMAKE_PROJECT_NAME}" "${CMAKE_PROJECT_VERSION}" swiftSwiftOnoneSupport) |
0 commit comments