@@ -628,7 +628,6 @@ function(_add_swift_target_library_single target name)
628
628
OBJECT_LIBRARY
629
629
SHARED
630
630
STATIC
631
- TARGET_LIBRARY
632
631
INSTALL_WITH_SHARED )
633
632
set (SWIFTLIB_SINGLE_single_parameter_options
634
633
ARCHITECTURE
@@ -856,7 +855,7 @@ function(_add_swift_target_library_single target name)
856
855
endforeach ()
857
856
858
857
set (SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES )
859
- if (XCODE AND SWIFTLIB_SINGLE_TARGET_LIBRARY )
858
+ if (XCODE )
860
859
set (SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES
861
860
# Note: the dummy.cpp source file provides no definitions. However,
862
861
# it forces Xcode to properly link the static library.
@@ -879,8 +878,7 @@ function(_add_swift_target_library_single target name)
879
878
target_include_directories (${target} BEFORE PRIVATE
880
879
${SWIFT_SOURCE_DIR} /stdlib/include )
881
880
if (("${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "ELF" OR
882
- "${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "COFF" ) AND
883
- SWIFTLIB_SINGLE_TARGET_LIBRARY )
881
+ "${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "COFF" ))
884
882
if ("${libkind} " STREQUAL "SHARED" AND NOT SWIFTLIB_SINGLE_NOSWIFTRT )
885
883
# TODO(compnerd) switch to the generator expression when cmake is upgraded
886
884
# to a version which supports it.
@@ -943,27 +941,25 @@ function(_add_swift_target_library_single target name)
943
941
SUFFIX ${LLVM_PLUGIN_EXT} )
944
942
endif ()
945
943
946
- if (SWIFTLIB_SINGLE_TARGET_LIBRARY )
947
- # Install runtime libraries to lib/swift instead of lib. This works around
948
- # the fact that -isysroot prevents linking to libraries in the system
949
- # /usr/lib if Swift is installed in /usr.
950
- set_target_properties ("${target} " PROPERTIES
951
- LIBRARY_OUTPUT_DIRECTORY ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR}
952
- ARCHIVE_OUTPUT_DIRECTORY ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR} )
953
- if (SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND SWIFTLIB_SINGLE_IS_STDLIB_CORE
954
- AND libkind STREQUAL SHARED )
955
- add_custom_command (TARGET ${target} POST_BUILD
956
- COMMAND ${CMAKE_COMMAND} -E copy_if_different $< TARGET_FILE:${target} > ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR} )
957
- endif ()
958
-
959
- foreach (config ${CMAKE_CONFIGURATION_TYPES} )
960
- string (TOUPPER ${config} config_upper )
961
- escape_path_for_xcode ("${config} " "${SWIFTLIB_DIR} " config_lib_dir )
962
- set_target_properties (${target} PROPERTIES
963
- LIBRARY_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir} /${SWIFTLIB_SINGLE_SUBDIR}
964
- ARCHIVE_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir} /${SWIFTLIB_SINGLE_SUBDIR} )
965
- endforeach ()
966
- endif ()
944
+ # Install runtime libraries to lib/swift instead of lib. This works around
945
+ # the fact that -isysroot prevents linking to libraries in the system
946
+ # /usr/lib if Swift is installed in /usr.
947
+ set_target_properties ("${target} " PROPERTIES
948
+ LIBRARY_OUTPUT_DIRECTORY ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR}
949
+ ARCHIVE_OUTPUT_DIRECTORY ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR} )
950
+ if (SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND SWIFTLIB_SINGLE_IS_STDLIB_CORE
951
+ AND libkind STREQUAL SHARED )
952
+ add_custom_command (TARGET ${target} POST_BUILD
953
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different $< TARGET_FILE:${target} > ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR} )
954
+ endif ()
955
+
956
+ foreach (config ${CMAKE_CONFIGURATION_TYPES} )
957
+ string (TOUPPER ${config} config_upper )
958
+ escape_path_for_xcode ("${config} " "${SWIFTLIB_DIR} " config_lib_dir )
959
+ set_target_properties (${target} PROPERTIES
960
+ LIBRARY_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir} /${SWIFTLIB_SINGLE_SUBDIR}
961
+ ARCHIVE_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir} /${SWIFTLIB_SINGLE_SUBDIR} )
962
+ endforeach ()
967
963
968
964
if (SWIFTLIB_SINGLE_SDK IN_LIST SWIFT_DARWIN_PLATFORMS )
969
965
set (install_name_dir "@rpath" )
@@ -999,9 +995,7 @@ function(_add_swift_target_library_single target name)
999
995
# for an Android cross-build from a macOS host. Construct the proper linker
1000
996
# flags manually in add_swift_target_library instead, see there with
1001
997
# variable `swiftlib_link_flags_all`.
1002
- if (SWIFTLIB_SINGLE_TARGET_LIBRARY )
1003
- set_target_properties ("${target} " PROPERTIES NO_SONAME TRUE )
1004
- endif ()
998
+ set_target_properties ("${target} " PROPERTIES NO_SONAME TRUE )
1005
999
# Only set the install RPATH if the toolchain and stdlib will be in Termux
1006
1000
# or some other native sysroot on Android.
1007
1001
if (NOT "${SWIFT_ANDROID_NATIVE_SYSROOT} " STREQUAL "" )
@@ -1068,11 +1062,9 @@ function(_add_swift_target_library_single target name)
1068
1062
1069
1063
# Don't build standard libraries by default. We will enable building
1070
1064
# standard libraries that the user requested; the rest can be built on-demand.
1071
- if (SWIFTLIB_SINGLE_TARGET_LIBRARY )
1072
- foreach (t "${target} " ${target_static} )
1073
- set_target_properties (${t} PROPERTIES EXCLUDE_FROM_ALL TRUE )
1074
- endforeach ()
1075
- endif ()
1065
+ foreach (t "${target} " ${target_static} )
1066
+ set_target_properties (${t} PROPERTIES EXCLUDE_FROM_ALL TRUE )
1067
+ endforeach ()
1076
1068
1077
1069
# Handle linking and dependencies.
1078
1070
add_dependencies_multiple_targets (
@@ -1147,15 +1139,8 @@ function(_add_swift_target_library_single target name)
1147
1139
list (APPEND library_search_directories "${SWIFT_SDK_${sdk} _ARCH_${arch} _PATH}/usr/lib/swift" )
1148
1140
1149
1141
# Add variant-specific flags.
1150
- if (SWIFTLIB_SINGLE_TARGET_LIBRARY )
1151
- set (build_type "${SWIFT_STDLIB_BUILD_TYPE} " )
1152
- set (enable_assertions "${SWIFT_STDLIB_ASSERTIONS} " )
1153
- else ()
1154
- set (build_type "${CMAKE_BUILD_TYPE} " )
1155
- set (enable_assertions "${LLVM_ENABLE_ASSERTIONS} " )
1156
- set (analyze_code_coverage "${SWIFT_ANALYZE_CODE_COVERAGE} " )
1157
- endif ()
1158
-
1142
+ set (build_type "${SWIFT_STDLIB_BUILD_TYPE} " )
1143
+ set (enable_assertions "${SWIFT_STDLIB_ASSERTIONS} " )
1159
1144
set (lto_type "${SWIFT_STDLIB_ENABLE_LTO} " )
1160
1145
1161
1146
_add_target_variant_c_compile_flags (
@@ -1994,7 +1979,6 @@ function(add_swift_target_library name)
1994
1979
${SWIFTLIB_OBJECT_LIBRARY_keyword}
1995
1980
${SWIFTLIB_INSTALL_WITH_SHARED_keyword}
1996
1981
${SWIFTLIB_SOURCES}
1997
- TARGET_LIBRARY
1998
1982
MODULE_TARGETS ${module_variant_names}
1999
1983
SDK ${sdk}
2000
1984
ARCHITECTURE ${arch}
0 commit comments