Skip to content

Commit 7297d76

Browse files
authored
[CMake] Stop symlinking build/llvm/lib into build/swift/lib/swift/ (swiftlang#15458)
We started doing this to test out libFuzzer, but that's now available through the usual sanitizer interface, and it turns out this symlink is actually harmful because it causes the llvm/lib/ folder to get copied into the built LLDB framework, and it contains all sorts of garbage intermediate files (static libraries and such). On my machine it was an extra 9GB for no reason. Anyway, we're not using this anymore, so take it out. I suggest clearing out build/lib/swift/ after this change too.
1 parent 2fe753e commit 7297d76

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

stdlib/public/SwiftShims/CMakeLists.txt

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,10 @@ function(find_llvm_clang_headers suffix description out_var)
101101
endfunction()
102102

103103
if(SWIFT_BUILT_STANDALONE)
104-
find_llvm_clang_headers("" "LLVM" llvm_headers_location)
105104
find_llvm_clang_headers("/clang/${CLANG_VERSION}" "Clang"
106105
clang_headers_location)
107106
else() # NOT SWIFT_BUILT_STANDALONE
108107
set(clang_headers_location "${LLVM_LIBRARY_DIR}/clang/${CLANG_VERSION}")
109-
set(llvm_headers_location "${LLVM_LIBRARY_DIR}")
110108
endif()
111109

112110
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
@@ -126,20 +124,7 @@ add_custom_command_target(unused_var
126124
CUSTOM_TARGET_NAME "symlink_clang_headers"
127125
OUTPUT "${SWIFTLIB_DIR}/clang"
128126
COMMENT "Symlinking Clang resource headers into ${SWIFTLIB_DIR}/clang")
129-
130-
# Adding LLVM symlink at compile time.
131-
add_custom_command_target(unused_var2
132-
COMMAND
133-
"${CMAKE_COMMAND}" "-E" "make_directory" "${SWIFTLIB_DIR}"
134-
COMMAND
135-
"${CMAKE_COMMAND}" "-E" "${cmake_symlink_option}"
136-
"${llvm_headers_location}"
137-
"${SWIFTLIB_DIR}/llvm"
138-
139-
CUSTOM_TARGET_NAME "symlink_llvm_headers"
140-
OUTPUT "${SWIFTLIB_DIR}/llvm"
141-
COMMENT "Symlinking LLVM resource headers into ${SWIFTLIB_DIR}/llvm")
142-
add_dependencies(copy_shim_headers symlink_clang_headers symlink_llvm_headers)
127+
add_dependencies(copy_shim_headers symlink_clang_headers)
143128

144129
swift_install_in_component(compiler
145130
FILES ${sources}

0 commit comments

Comments
 (0)