Skip to content

Commit df208b3

Browse files
committed
build: honour the libdispatch build type
When configuring libdispatch as part of the swift build on Linux with SourceKit enabled, we would default to a release build. However, that results in known leaks being reported with LSAN when building with a debug standard library. Pass along the `LIBDISPATCH_BUILD_TYPE` into the CMake build and map that to the CMAKE_BUILD_TYPE for the project.
1 parent 06326af commit df208b3

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

tools/SourceKit/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
100100
BINARY_DIR
101101
"${SWIFT_PATH_TO_LIBDISPATCH_BUILD}"
102102
CMAKE_ARGS
103+
-DCMAKE_BUILD_TYPE=${LIBDISPATCH_CMAKE_BUILD_TYPE}
103104
-DCMAKE_C_COMPILER=${PATH_TO_CLANG_BUILD}/bin/clang
104105
-DCMAKE_CXX_COMPILER=${PATH_TO_CLANG_BUILD}/bin/clang++
105106
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}

utils/build-presets.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ release-debuginfo
961961
assertions
962962
enable-lsan
963963
debug-swift-stdlib
964+
debug-libdispatch
964965

965966
dash-dash
966967

utils/build-script-impl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,6 +2132,7 @@ for host in "${ALL_HOSTS[@]}"; do
21322132
-DSWIFT_EMBED_BITCODE_SECTION:BOOL=$(true_false "${EMBED_BITCODE_SECTION}")
21332133
-DSWIFT_TOOLS_ENABLE_LTO:STRING="${SWIFT_TOOLS_ENABLE_LTO}"
21342134
-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER:BOOL=$(true_false "${BUILD_RUNTIME_WITH_HOST_COMPILER}")
2135+
-DLIBDISPATCH_CMAKE_BUILD_TYPE:STRING="${LIBDISPATCH_BUILD_TYPE}"
21352136
"${swift_cmake_options[@]}"
21362137
)
21372138

0 commit comments

Comments
 (0)