termux-packages/disabled-packages/swift/swift-tools-SourceKit-cmake-modules-AddSwiftSourceKit.cmake.patch

36 lines
1.7 KiB
Diff
Raw Normal View History

commit 799eb632c86f0171300f9b30f0f8d6586bdc3310
Author: Alex Langford <apl@fb.com>
Date: Tue Apr 2 12:04:19 2019 -0700
[CMake] Make SourceKit respect link_libraries and library_search_directories
add_sourcekit_default_compiler_flags was invoking
_add_variant_link_flags and getting link flags but not actually using
the link_libraries or library_search_directories. In android builds,
this means that the correct libc++ is not being linked against.
diff --git a/swift/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake b/swift/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
index c1535aa2d3..1f7eebe40f 100644
--- a/swift/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ b/swift/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -66,7 +66,9 @@ function(add_sourcekit_default_compiler_flags target)
ENABLE_LTO "${SWIFT_TOOLS_ENABLE_LTO}"
LTO_OBJECT_NAME "${target}-${sdk}-${arch}"
ANALYZE_CODE_COVERAGE "${analyze_code_coverage}"
- RESULT_VAR_NAME link_flags)
+ RESULT_VAR_NAME link_flags
+ LINK_LIBRARIES_VAR_NAME link_libraries
+ LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories)
# Convert variables to space-separated strings.
_list_escape_for_shell("${c_compile_flags}" c_compile_flags)
@@ -77,6 +79,8 @@ function(add_sourcekit_default_compiler_flags target)
COMPILE_FLAGS " ${c_compile_flags} -fblocks")
set_property(TARGET "${target}" APPEND_STRING PROPERTY
LINK_FLAGS " ${link_flags}")
+ set_property(TARGET "${target}" APPEND PROPERTY LINK_LIBRARIES ${link_libraries})
+ swift_target_link_search_directories("${target}" "${library_search_directories}")
endfunction()
# Add a new SourceKit library.