diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index 76a2e323510df..0e1264b0edc26 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -271,6 +271,9 @@ llvm_canonicalize_cmake_booleans( llvm_canonicalize_cmake_booleans( LLDB_ENABLE_SWIFT_SUPPORT ) + +set(LLDB_SWIFT_DRIVER_EXTRA_FLAGS "" CACHE STRING + "Additional swift driver arguments for LLDB shell tests") # END SWIFT # Configure the individual test suites. diff --git a/lldb/test/Shell/helper/toolchain.py b/lldb/test/Shell/helper/toolchain.py index 07abb9cee180b..d176a5dca240d 100644 --- a/lldb/test/Shell/helper/toolchain.py +++ b/lldb/test/Shell/helper/toolchain.py @@ -260,6 +260,9 @@ def use_support_substitutions(config): swift_driver_args = [] if platform.system() in ["Darwin"]: swift_args += ["-sdk", sdk_path] + swift_driver_extra_args = getattr(config, "swift_driver_extra_args", []) + if swift_driver_extra_args: + swift_args += swift_driver_extra_args tools = [ ToolSubst( "%target-swiftc", diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in index 0eff04f22d9e3..8891ae91a48ca 100644 --- a/lldb/test/Shell/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -24,6 +24,10 @@ config.python_executable = "@Python3_EXECUTABLE@" config.python_root_dir = "@Python3_ROOT_DIR@" config.swiftc = "@LLDB_SWIFTC@" config.swift_libs_dir = '@LLDB_SWIFT_LIBS@' +# BEGIN SWIFT +_swift_driver_flags = lit_config.substitute("@LLDB_SWIFT_DRIVER_EXTRA_FLAGS@") +config.swift_driver_extra_args = [flag.strip() for flag in _swift_driver_flags.split(";") if flag.strip()] +# END SWIFT config.lldb_enable_swift = @LLDB_ENABLE_SWIFT_SUPPORT@ config.have_zlib = @LLVM_ENABLE_ZLIB@ config.objc_gnustep_dir = "@LLDB_TEST_OBJC_GNUSTEP_DIR@"