@@ -4,11 +4,7 @@ include(SwiftUtils)
44# Compute the library subdirectory to use for the given sdk and
55# architecture, placing the result in 'result_var_name'.
66function (compute_library_subdir result_var_name sdk arch)
7- if (sdk IN_LIST SWIFT_APPLE_PLATFORMS OR sdk STREQUAL "MACCATALYST" )
8- set ("${result_var_name} " "${SWIFT_SDK_${sdk} _LIB_SUBDIR}" PARENT_SCOPE)
9- else ()
10- set ("${result_var_name} " "${SWIFT_SDK_${sdk} _LIB_SUBDIR}/${arch} " PARENT_SCOPE)
11- endif ()
7+ set ("${result_var_name} " "${SWIFT_SDK_${sdk} _LIB_SUBDIR}" PARENT_SCOPE)
128endfunction ()
139
1410# Return a swiftc flag (e.g. -O or -Onone) to control optimization level based
@@ -496,17 +492,10 @@ function(_compile_swift_files
496492 set (module_base_static "${module_dir_static} /${SWIFTFILE_MODULE_NAME} " )
497493
498494 set (module_triple ${SWIFT_SDK_${library_subdir_sdk} _ARCH_${SWIFTFILE_ARCHITECTURE} _MODULE})
499- if (SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS OR
500- SWIFTFILE_SDK STREQUAL "MACCATALYST" )
501- set (specific_module_dir "${module_base} .swiftmodule" )
502- set (module_base "${module_base} .swiftmodule/${module_triple} " )
503-
504- set (specific_module_dir_static "${module_base_static} .swiftmodule" )
505- set (module_base_static "${module_base_static} .swiftmodule/${module_triple} " )
506- else ()
507- set (specific_module_dir)
508- set (specific_module_dir_static)
509- endif ()
495+ set (specific_module_dir "${module_base} .swiftmodule" )
496+ set (module_base "${module_base} .swiftmodule/${module_triple} " )
497+ set (specific_module_dir_static "${module_base_static} .swiftmodule" )
498+ set (module_base_static "${module_base_static} .swiftmodule/${module_triple} " )
510499 set (module_file "${module_base} .swiftmodule" )
511500 set (module_doc_file "${module_base} .swiftdoc" )
512501
@@ -544,25 +533,13 @@ function(_compile_swift_files
544533 set (optional_arg "OPTIONAL" )
545534 endif ()
546535
547- if (SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS OR
548- SWIFTFILE_SDK STREQUAL "MACCATALYST" )
549- swift_install_in_component(DIRECTORY "${specific_module_dir} "
550- DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift/${library_subdir} "
551- COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} " )
552- if (SWIFTFILE_STATIC)
553- swift_install_in_component(DIRECTORY "${specific_module_dir_static} "
554- DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift_static/${library_subdir} "
555- COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} " )
556- endif ()
557- else ()
558- swift_install_in_component(FILES ${module_outputs}
559- DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift/${library_subdir} "
536+ swift_install_in_component(DIRECTORY "${specific_module_dir} "
537+ DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift/${library_subdir} "
538+ COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} " )
539+ if (SWIFTFILE_STATIC)
540+ swift_install_in_component(DIRECTORY "${specific_module_dir_static} "
541+ DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift_static/${library_subdir} "
560542 COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} " )
561- if (SWIFTFILE_STATIC)
562- swift_install_in_component(FILES ${module_outputs}
563- DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift_static/${library_subdir} "
564- COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} " )
565- endif ()
566543 endif ()
567544
568545 # macCatalyst zippered module setup
@@ -618,29 +595,18 @@ function(_compile_swift_files
618595 list (APPEND module_outputs_static "${interface_file_static} " )
619596 endif ()
620597
621- if (SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
622- swift_install_in_component(DIRECTORY "${specific_module_dir} "
623- DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift/${library_subdir} "
598+ swift_install_in_component(DIRECTORY "${specific_module_dir} "
599+ DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift/${library_subdir} "
600+ COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} "
601+ OPTIONAL
602+ PATTERN "Project" EXCLUDE )
603+
604+ if (SWIFTFILE_STATIC)
605+ swift_install_in_component(DIRECTORY "${specific_module_dir_static} "
606+ DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift_static/${library_subdir} "
624607 COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} "
625608 OPTIONAL
626609 PATTERN "Project" EXCLUDE )
627-
628- if (SWIFTFILE_STATIC)
629- swift_install_in_component(DIRECTORY "${specific_module_dir_static} "
630- DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift_static/${library_subdir} "
631- COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} "
632- OPTIONAL
633- PATTERN "Project" EXCLUDE )
634- endif ()
635- else ()
636- swift_install_in_component(FILES ${module_outputs}
637- DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift/${library_subdir} "
638- COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} " )
639- if (SWIFTFILE_STATIC)
640- swift_install_in_component(FILES ${module_outputs}
641- DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift_static/${library_subdir} "
642- COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT} " )
643- endif ()
644610 endif ()
645611
646612 set (line_directive_tool "${SWIFT_SOURCE_DIR} /utils/line-directive" )
0 commit comments