Skip to content

Commit e73208f

Browse files
authored
Merge pull request swiftlang#12801 from adierking/section-magic
2 parents 0390d45 + 2898477 commit e73208f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ function(_add_swift_library_single target name)
719719
# On platforms that use ELF binaries we add markers for metadata sections in
720720
# the shared libraries using these object files. This wouldn't be necessary
721721
# if the link was done by the swift binary: rdar://problem/19007002
722-
if(SWIFTLIB_TARGET_LIBRARY AND
722+
if(SWIFTLIB_SINGLE_TARGET_LIBRARY AND
723723
"${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
724724
if("${libkind}" STREQUAL "SHARED")
725725
set(arch_subdir "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}")
@@ -874,7 +874,8 @@ function(_add_swift_library_single target name)
874874

875875
# The section metadata objects are generated sources, and we need to tell CMake
876876
# not to expect to find them prior to their generation.
877-
if("${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
877+
if(SWIFTLIB_SINGLE_TARGET_LIBRARY AND
878+
"${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
878879
if("${libkind}" STREQUAL "SHARED")
879880
set_source_files_properties(${SWIFT_SECTIONS_OBJECT_BEGIN} PROPERTIES GENERATED 1)
880881
set_source_files_properties(${SWIFT_SECTIONS_OBJECT_END} PROPERTIES GENERATED 1)

0 commit comments

Comments
 (0)