Skip to content

Commit 1131507

Browse files
committed
[Testing] Add a substitution for %target-is-simulator.
1 parent 5e2c815 commit 1131507

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/Testing.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ code for the target that is not the build machine:
311311
* ``%target-os``: the target operating system (``macosx``, ``darwin``,
312312
``linux``, ``freebsd``, ``windows-cygnus``, ``windows-gnu``).
313313

314+
* ``%target-is-simulator``: ``true`` if the target is a simulator (iOS,
315+
watchOS, tvOS), otherwise ``false``.
316+
314317
* ``%target-object-format``: the platform's object format (``elf``, ``macho``,
315318
``coff``).
316319

test/lit.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,17 @@ if (not getattr(config, 'target_run', None) and
10051005
config.substitutions.append(('%env-', TARGET_ENV_PREFIX))
10061006
config.substitutions.append(("%target-sdk-name", config.target_sdk_name))
10071007

1008+
simulator_sdks = [
1009+
'iphonesimulator',
1010+
'watchsimulator',
1011+
'appletvsimulator'
1012+
]
1013+
if config.target_sdk_name in simulator_sdks:
1014+
config.substitutions.append(('%target-is-simulator', 'true'))
1015+
else:
1016+
config.substitutions.append(('%target-is-simulator', 'false'))
1017+
1018+
10081019
config.compiler_rt_libs = []
10091020
config.compiler_rt_platform = {
10101021
'iphoneos': 'ios',

0 commit comments

Comments
 (0)