Skip to content

Commit f2ddef7

Browse files
authored
Merge pull request #78498 from etcwilde/ewilde/stdlib-rebuild-lazy-init-os-trace
CMake: SwiftCore: SWIFT_USE_OS_TRACE_LAZY_INIT
2 parents 7bbd5d7 + d470565 commit f2ddef7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ include(Plist)
7474
check_symbol_exists("asl_log" "asl.h" SwiftCore_HAS_ASL)
7575
check_symbol_exists("dladdr" "dlfcn.h" SwiftCore_HAS_DLADDR)
7676
check_symbol_exists("dlsym" "dlfcn.h" SwiftCore_HAS_DLSYM)
77+
check_symbol_exists("os_trace" "os/trace.h" SwiftCore_HAS_OS_TRACE)
7778

7879
check_include_file_cxx("clocale" SwiftCore_HAS_LOCALE)
7980

@@ -100,6 +101,7 @@ defaulted_option(SwiftCore_ENABLE_STDLIB_TRACING "Enable tracing in the runtime.
100101
option(SwiftCore_ENABLE_UNICODE_DATA "Include unicode data in Swift runtimes" ON)
101102
option(SwiftCore_ENABLE_SHORT_MANGLING_LOOKUPS "Build with fast-path context descriptor lookups based on well-known short manglings." ON)
102103
option(SwiftCore_ENABLE_FILESYSTEM_SUPPORT "Build for systems that have a filesystem" ON)
104+
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})
103105

104106
defaulted_option(SwiftCore_ENABLE_BACKTRACING "Enable backtracing runtime support")
105107
defaulted_set(SwiftCore_BACKTRACER_PATH STRING "Set a fixed path to the Swift backtracer")

Runtimes/Core/runtime/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ target_compile_definitions(swiftRuntime
100100
$<$<BOOL:${SwiftCore_HAS_DLSYM}>:-DSWIFT_STDLIB_HAS_DLSYM>
101101
$<$<BOOL:${SwiftCore_ENABLE_FILESYSTEM_SUPPORT}>:-DSWIFT_STDLIB_HAS_FILESYSTEM>
102102
$<$<BOOL:${SwiftCore_ENABLE_FILESYSTEM_SUPPORT}>:-DSWIFT_ARCH="${SwiftCore_ARCH_SUBDIR}">
103-
$<$<BOOL:${SwiftCore_ENABLE_FILESYSTEM_SUPPORT}>:-DSWIFT_LIB_SUBDIR="${SwiftCore_PLATFORM_SUBDIR}">)
103+
$<$<BOOL:${SwiftCore_ENABLE_FILESYSTEM_SUPPORT}>:-DSWIFT_LIB_SUBDIR="${SwiftCore_PLATFORM_SUBDIR}">
104+
PUBLIC
105+
$<$<BOOL:${SwiftCore_ENABLE_OS_TRACE_LAZY_INIT}>:-DSWIFT_USE_OS_TRACE_LAZY_INIT>)
104106

105107
target_include_directories(swiftRuntime PRIVATE
106108
"${PROJECT_BINARY_DIR}/include"

0 commit comments

Comments
 (0)