Skip to content

Commit 088f469

Browse files
authored
Merge pull request #3328 from compnerd/simplify-elf-check
2 parents 67e2362 + 970c059 commit 088f469

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -578,20 +578,16 @@ function(_add_swift_library_single target name)
578578
set(SWIFTLIB_SINGLE_API_NOTES "${module_name}")
579579
endif()
580580

581-
# On platforms that use ELF binaries (for now that is Linux and FreeBSD)
582-
# we add markers for metadata sections in the shared libraries using
583-
# these object files. This wouldn't be necessary if the link was done by
584-
# the swift binary: rdar://problem/19007002
585-
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "LINUX" OR
586-
"${SWIFTLIB_SINGLE_SDK}" STREQUAL "FREEBSD")
587-
581+
# On platforms that use ELF binaries we add markers for metadata sections in
582+
# the shared libraries using these object files. This wouldn't be necessary
583+
# if the link was done by the swift binary: rdar://problem/19007002
584+
if("${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
588585
if("${libkind}" STREQUAL "SHARED")
589586
set(arch_subdir "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}")
590587

591588
set(SWIFT_SECTIONS_OBJECT_BEGIN "${arch_subdir}/swift_begin.o")
592589
set(SWIFT_SECTIONS_OBJECT_END "${arch_subdir}/swift_end.o")
593590
endif()
594-
595591
endif()
596592

597593
# FIXME: don't actually depend on the libraries in SWIFTLIB_SINGLE_LINK_LIBRARIES,

0 commit comments

Comments
 (0)