Skip to content

Commit d755025

Browse files
committed
[lldb][test] Add --sysroot argument to dotest.py
This argument allows to set specific sysroot pass which will be used for building LLDB API test programs. It might come in handy for setting up cross-platform remote runs of API tests on Windows host. It can be useful for cross-compiling LLDB API tests. The argument can be set using `LLDB_TEST_USER_ARGS` argument: ``` cmake ... -DLLDB_TEST_USER_ARGS="...;--sysroot;C:\path\to\sysroot;..." ... ```
1 parent 419d363 commit d755025

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ def parseOptionsAndInitTestdirs():
304304
lldbtest_config.out_of_tree_debugserver = args.out_of_tree_debugserver
305305

306306
# Set SDKROOT if we are using an Apple SDK
307-
if platform_system == "Darwin" and args.apple_sdk:
307+
if args.sysroot is not None:
308+
configuration.sdkroot = args.sysroot
309+
elif platform_system == "Darwin" and args.apple_sdk:
308310
configuration.sdkroot = seven.get_command_output(
309311
'xcrun --sdk "%s" --show-sdk-path 2> /dev/null' % (args.apple_sdk)
310312
)

lldb/packages/Python/lldbsuite/test/dotest_args.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ def create_parser():
4949
"""Specify the compiler(s) used to build the inferior executables. The compiler path can be an executable basename or a full path to a compiler executable. This option can be specified multiple times."""
5050
),
5151
)
52+
group.add_argument(
53+
"--sysroot",
54+
metavar="sysroot",
55+
dest="sysroot",
56+
default="",
57+
help=textwrap.dedent(
58+
"""Specify the path to sysroot. This overrides apple_sdk sysroot."""
59+
),
60+
)
5261
if sys.platform == "darwin":
5362
group.add_argument(
5463
"--apple-sdk",

0 commit comments

Comments
 (0)