CMake: SwiftCore: SWIFT_USE_OS_TRACE_LAZY_INIT

Adding the SWIFT_USE_OS_TRACE_LAZY_INIT macro to the new build system.

rdar://142440689
This commit is contained in:
Evan Wilde
2025-01-08 14:49:14 -08:00
parent 11fbd94668
commit d470565e2d
2 changed files with 5 additions and 1 deletions

View File

@@ -74,6 +74,7 @@ include(Plist)
check_symbol_exists("asl_log" "asl.h" SwiftCore_HAS_ASL)
check_symbol_exists("dladdr" "dlfcn.h" SwiftCore_HAS_DLADDR)
check_symbol_exists("dlsym" "dlfcn.h" SwiftCore_HAS_DLSYM)
check_symbol_exists("os_trace" "os/trace.h" SwiftCore_HAS_OS_TRACE)
check_include_file_cxx("clocale" SwiftCore_HAS_LOCALE)
@@ -100,6 +101,7 @@ defaulted_option(SwiftCore_ENABLE_STDLIB_TRACING "Enable tracing in the runtime.
option(SwiftCore_ENABLE_UNICODE_DATA "Include unicode data in Swift runtimes" ON)
option(SwiftCore_ENABLE_SHORT_MANGLING_LOOKUPS "Build with fast-path context descriptor lookups based on well-known short manglings." ON)
option(SwiftCore_ENABLE_FILESYSTEM_SUPPORT "Build for systems that have a filesystem" ON)
option(SwiftCore_ENABLE_OS_TRACE_LAZY_INIT "Use os_trace call to check if lazy init has been completed before making os_signpost calls." ${SwiftCore_HAS_OS_TRACE})
defaulted_option(SwiftCore_ENABLE_BACKTRACING "Enable backtracing runtime support")
defaulted_set(SwiftCore_BACKTRACER_PATH STRING "Set a fixed path to the Swift backtracer")

View File

@@ -100,7 +100,9 @@ target_compile_definitions(swiftRuntime
$<$<BOOL:${SwiftCore_HAS_DLSYM}>:-DSWIFT_STDLIB_HAS_DLSYM>
$<$<BOOL:${SwiftCore_ENABLE_FILESYSTEM_SUPPORT}>:-DSWIFT_STDLIB_HAS_FILESYSTEM>
$<$<BOOL:${SwiftCore_ENABLE_FILESYSTEM_SUPPORT}>:-DSWIFT_ARCH="${SwiftCore_ARCH_SUBDIR}">
$<$<BOOL:${SwiftCore_ENABLE_FILESYSTEM_SUPPORT}>:-DSWIFT_LIB_SUBDIR="${SwiftCore_PLATFORM_SUBDIR}">)
$<$<BOOL:${SwiftCore_ENABLE_FILESYSTEM_SUPPORT}>:-DSWIFT_LIB_SUBDIR="${SwiftCore_PLATFORM_SUBDIR}">
PUBLIC
$<$<BOOL:${SwiftCore_ENABLE_OS_TRACE_LAZY_INIT}>:-DSWIFT_USE_OS_TRACE_LAZY_INIT>)
target_include_directories(swiftRuntime PRIVATE
"${PROJECT_BINARY_DIR}/include"