termux-packages/packages/swift/swift-no-test-build.patch

63 lines
2.4 KiB
Diff

commit 86c40574f594f4f7b4b25bb02cc2389e1328c200
Date: Fri Nov 13 17:22:09 2020 +0530
[build] Don't build test targets in tools/ if SWIFT_INCLUDE_TESTS is turned off
diff --git a/swift/tools/CMakeLists.txt b/swift/tools/CMakeLists.txt
index 2bd8352bf273..ea610709e2f5 100644
--- a/swift/tools/CMakeLists.txt
+++ b/swift/tools/CMakeLists.txt
@@ -16,13 +16,10 @@ endif()
add_swift_tool_subdirectory(driver)
add_swift_tool_subdirectory(sil-opt)
add_swift_tool_subdirectory(swift-dependency-tool)
-add_swift_tool_subdirectory(swift-ide-test)
-add_swift_tool_subdirectory(swift-remoteast-test)
add_swift_tool_subdirectory(swift-demangle)
add_swift_tool_subdirectory(swift-demangle-yamldump)
add_swift_tool_subdirectory(swift-def-to-yaml-converter)
add_swift_tool_subdirectory(swift-serialize-diagnostics)
-add_swift_tool_subdirectory(lldb-moduleimport-test)
add_swift_tool_subdirectory(sil-func-extractor)
add_swift_tool_subdirectory(sil-llvm-gen)
add_swift_tool_subdirectory(sil-nm)
@@ -30,11 +27,19 @@ add_swift_tool_subdirectory(sil-passpipeline-dumper)
add_swift_tool_subdirectory(swift-llvm-opt)
add_swift_tool_subdirectory(swift-api-digester)
add_swift_tool_subdirectory(swift-ast-script)
-add_swift_tool_subdirectory(swift-syntax-test)
add_swift_tool_subdirectory(swift-refactor)
if(SWIFT_BUILD_SYNTAXPARSERLIB)
add_swift_tool_subdirectory(libSwiftSyntaxParser)
- add_swift_tool_subdirectory(swift-syntax-parser-test)
+ if(SWIFT_INCLUDE_TESTS)
+ add_swift_tool_subdirectory(swift-syntax-parser-test)
+ endif()
+endif()
+
+if(SWIFT_INCLUDE_TESTS)
+ add_swift_tool_subdirectory(swift-ide-test)
+ add_swift_tool_subdirectory(swift-remoteast-test)
+ add_swift_tool_subdirectory(lldb-moduleimport-test)
+ add_swift_tool_subdirectory(swift-syntax-test)
endif()
if(LLVM_USE_SANITIZE_COVERAGE)
diff --git a/swift/tools/SourceKit/tools/CMakeLists.txt b/swift/tools/SourceKit/tools/CMakeLists.txt
index 739078c36e52..75cf0861b11e 100644
--- a/swift/tools/SourceKit/tools/CMakeLists.txt
+++ b/swift/tools/SourceKit/tools/CMakeLists.txt
@@ -5,8 +5,10 @@ include_directories(
)
add_swift_lib_subdirectory(sourcekitd)
-add_swift_tool_subdirectory(sourcekitd-test)
if(LibEdit_FOUND AND LibEdit_HAS_UNICODE)
add_swift_tool_subdirectory(sourcekitd-repl)
endif()
-add_swift_tool_subdirectory(complete-test)
+if(SWIFT_INCLUDE_TESTS)
+ add_swift_tool_subdirectory(sourcekitd-test)
+ add_swift_tool_subdirectory(complete-test)
+endif()