mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This commit disables runtime stack trace dumping via dladdr on Darwin when asserts are disabled. This stack trace dumping was added as a way to improve the ability to debug the compiler for compiler developers. This is all well and good but having such a feature always enabled prevents us from reducing the size of the swift standard library by eliminating the swift nlist. rdar://31372220
49 lines
1.6 KiB
CMake
49 lines
1.6 KiB
CMake
if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
|
|
("${SWIFT_HOST_VARIANT_ARCH}" STREQUAL "${SWIFT_PRIMARY_VARIANT_ARCH}"))
|
|
|
|
set(PLATFORM_SOURCES)
|
|
set(PLATFORM_TARGET_LINK_LIBRARIES)
|
|
|
|
if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
|
|
# Placeholder for Darwin Foundation tests (currently none)
|
|
# find_library(FOUNDATION_LIBRARY Foundation)
|
|
# list(APPEND PLATFORM_SOURCES
|
|
# YourTestNameHere.mm
|
|
# )
|
|
# # We need to link swiftCore on Darwin because the runtime still relies on
|
|
# # some stdlib hooks to implement SwiftObject.
|
|
# list(APPEND PLATFORM_TARGET_LINK_LIBRARIES
|
|
# ${FOUNDATION_LIBRARY}
|
|
# swiftStdlibUnittest${SWIFT_PRIMARY_VARIANT_SUFFIX}
|
|
# )
|
|
elseif(SWIFT_HOST_VARIANT STREQUAL "linux")
|
|
list(APPEND PLATFORM_TARGET_LINK_LIBRARIES
|
|
"atomic"
|
|
)
|
|
elseif(SWIFT_HOST_VARIANT STREQUAL "freebsd")
|
|
find_library(EXECINFO_LIBRARY execinfo)
|
|
list(APPEND PLATFORM_TARGET_LINK_LIBRARIES
|
|
${EXECINFO_LIBRARY}
|
|
)
|
|
endif()
|
|
|
|
add_swift_unittest(SwiftRuntimeLongTests
|
|
LongRefcounting.cpp
|
|
../Stdlib.cpp
|
|
${PLATFORM_SOURCES}
|
|
|
|
# The runtime tests link to internal runtime symbols, which aren't exported
|
|
# from the swiftCore dylib, so we need to link to both the runtime archive
|
|
# and the stdlib.
|
|
$<TARGET_OBJECTS:swiftRuntime${SWIFT_PRIMARY_VARIANT_SUFFIX}>
|
|
)
|
|
|
|
# FIXME: cross-compile for all variants.
|
|
target_link_libraries(SwiftRuntimeLongTests
|
|
swiftCore${SWIFT_PRIMARY_VARIANT_SUFFIX}
|
|
${PLATFORM_TARGET_LINK_LIBRARIES}
|
|
${swift_runtime_test_extra_libraries}
|
|
)
|
|
endif()
|
|
|