@@ -622,7 +622,6 @@ function(_add_swift_target_library_single target name)
622
622
OBJECT_LIBRARY
623
623
SHARED
624
624
STATIC
625
- TARGET_LIBRARY
626
625
INSTALL_WITH_SHARED )
627
626
set (SWIFTLIB_SINGLE_single_parameter_options
628
627
ARCHITECTURE
@@ -850,7 +849,7 @@ function(_add_swift_target_library_single target name)
850
849
endforeach ()
851
850
852
851
set (SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES )
853
- if (XCODE AND SWIFTLIB_SINGLE_TARGET_LIBRARY )
852
+ if (XCODE )
854
853
set (SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES
855
854
# Note: the dummy.cpp source file provides no definitions. However,
856
855
# it forces Xcode to properly link the static library.
@@ -873,8 +872,7 @@ function(_add_swift_target_library_single target name)
873
872
target_include_directories (${target} BEFORE PRIVATE
874
873
${SWIFT_SOURCE_DIR} /stdlib/include )
875
874
if (("${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "ELF" OR
876
- "${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "COFF" ) AND
877
- SWIFTLIB_SINGLE_TARGET_LIBRARY )
875
+ "${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "COFF" ))
878
876
if ("${libkind} " STREQUAL "SHARED" AND NOT SWIFTLIB_SINGLE_NOSWIFTRT )
879
877
# TODO(compnerd) switch to the generator expression when cmake is upgraded
880
878
# to a version which supports it.
@@ -937,27 +935,25 @@ function(_add_swift_target_library_single target name)
937
935
SUFFIX ${LLVM_PLUGIN_EXT} )
938
936
endif ()
939
937
940
- if (SWIFTLIB_SINGLE_TARGET_LIBRARY )
941
- # Install runtime libraries to lib/swift instead of lib. This works around
942
- # the fact that -isysroot prevents linking to libraries in the system
943
- # /usr/lib if Swift is installed in /usr.
944
- set_target_properties ("${target} " PROPERTIES
945
- LIBRARY_OUTPUT_DIRECTORY ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR}
946
- ARCHIVE_OUTPUT_DIRECTORY ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR} )
947
- if (SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND SWIFTLIB_SINGLE_IS_STDLIB_CORE
948
- AND libkind STREQUAL SHARED )
949
- add_custom_command (TARGET ${target} POST_BUILD
950
- COMMAND ${CMAKE_COMMAND} -E copy_if_different $< TARGET_FILE:${target} > ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR} )
951
- endif ()
952
-
953
- foreach (config ${CMAKE_CONFIGURATION_TYPES} )
954
- string (TOUPPER ${config} config_upper )
955
- escape_path_for_xcode ("${config} " "${SWIFTLIB_DIR} " config_lib_dir )
956
- set_target_properties (${target} PROPERTIES
957
- LIBRARY_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir} /${SWIFTLIB_SINGLE_SUBDIR}
958
- ARCHIVE_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir} /${SWIFTLIB_SINGLE_SUBDIR} )
959
- endforeach ()
960
- endif ()
938
+ # Install runtime libraries to lib/swift instead of lib. This works around
939
+ # the fact that -isysroot prevents linking to libraries in the system
940
+ # /usr/lib if Swift is installed in /usr.
941
+ set_target_properties ("${target} " PROPERTIES
942
+ LIBRARY_OUTPUT_DIRECTORY ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR}
943
+ ARCHIVE_OUTPUT_DIRECTORY ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR} )
944
+ if (SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND SWIFTLIB_SINGLE_IS_STDLIB_CORE
945
+ AND libkind STREQUAL SHARED )
946
+ add_custom_command (TARGET ${target} POST_BUILD
947
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different $< TARGET_FILE:${target} > ${SWIFTLIB_DIR} /${SWIFTLIB_SINGLE_SUBDIR} )
948
+ endif ()
949
+
950
+ foreach (config ${CMAKE_CONFIGURATION_TYPES} )
951
+ string (TOUPPER ${config} config_upper )
952
+ escape_path_for_xcode ("${config} " "${SWIFTLIB_DIR} " config_lib_dir )
953
+ set_target_properties (${target} PROPERTIES
954
+ LIBRARY_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir} /${SWIFTLIB_SINGLE_SUBDIR}
955
+ ARCHIVE_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir} /${SWIFTLIB_SINGLE_SUBDIR} )
956
+ endforeach ()
961
957
962
958
if (SWIFTLIB_SINGLE_SDK IN_LIST SWIFT_APPLE_PLATFORMS )
963
959
set (install_name_dir "@rpath" )
@@ -993,9 +989,7 @@ function(_add_swift_target_library_single target name)
993
989
# for an Android cross-build from a macOS host. Construct the proper linker
994
990
# flags manually in add_swift_target_library instead, see there with
995
991
# variable `swiftlib_link_flags_all`.
996
- if (SWIFTLIB_SINGLE_TARGET_LIBRARY )
997
- set_target_properties ("${target} " PROPERTIES NO_SONAME TRUE )
998
- endif ()
992
+ set_target_properties ("${target} " PROPERTIES NO_SONAME TRUE )
999
993
# Only set the install RPATH if the toolchain and stdlib will be in Termux
1000
994
# or some other native sysroot on Android.
1001
995
if (NOT "${SWIFT_ANDROID_NATIVE_SYSROOT} " STREQUAL "" )
@@ -1062,11 +1056,9 @@ function(_add_swift_target_library_single target name)
1062
1056
1063
1057
# Don't build standard libraries by default. We will enable building
1064
1058
# standard libraries that the user requested; the rest can be built on-demand.
1065
- if (SWIFTLIB_SINGLE_TARGET_LIBRARY )
1066
- foreach (t "${target} " ${target_static} )
1067
- set_target_properties (${t} PROPERTIES EXCLUDE_FROM_ALL TRUE )
1068
- endforeach ()
1069
- endif ()
1059
+ foreach (t "${target} " ${target_static} )
1060
+ set_target_properties (${t} PROPERTIES EXCLUDE_FROM_ALL TRUE )
1061
+ endforeach ()
1070
1062
1071
1063
# Handle linking and dependencies.
1072
1064
add_dependencies_multiple_targets (
@@ -1141,15 +1133,8 @@ function(_add_swift_target_library_single target name)
1141
1133
list (APPEND library_search_directories "${SWIFT_SDK_${sdk} _ARCH_${arch} _PATH}/usr/lib/swift" )
1142
1134
1143
1135
# Add variant-specific flags.
1144
- if (SWIFTLIB_SINGLE_TARGET_LIBRARY )
1145
- set (build_type "${SWIFT_STDLIB_BUILD_TYPE} " )
1146
- set (enable_assertions "${SWIFT_STDLIB_ASSERTIONS} " )
1147
- else ()
1148
- set (build_type "${CMAKE_BUILD_TYPE} " )
1149
- set (enable_assertions "${LLVM_ENABLE_ASSERTIONS} " )
1150
- set (analyze_code_coverage "${SWIFT_ANALYZE_CODE_COVERAGE} " )
1151
- endif ()
1152
-
1136
+ set (build_type "${SWIFT_STDLIB_BUILD_TYPE} " )
1137
+ set (enable_assertions "${SWIFT_STDLIB_ASSERTIONS} " )
1153
1138
set (lto_type "${SWIFT_STDLIB_ENABLE_LTO} " )
1154
1139
1155
1140
_add_target_variant_c_compile_flags (
@@ -1988,7 +1973,6 @@ function(add_swift_target_library name)
1988
1973
${SWIFTLIB_OBJECT_LIBRARY_keyword}
1989
1974
${SWIFTLIB_INSTALL_WITH_SHARED_keyword}
1990
1975
${SWIFTLIB_SOURCES}
1991
- TARGET_LIBRARY
1992
1976
MODULE_TARGETS ${module_variant_names}
1993
1977
SDK ${sdk}
1994
1978
ARCHITECTURE ${arch}
0 commit comments