Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions test/Macros/SwiftifyImport/CxxSpan/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
def get_target_os():
import re
(run_cpu, run_vendor, run_os, run_version) = re.match('([^-]+)-([^-]+)-([^0-9]+)(.*)', config.variant_triple).groups()
return run_os

if config.target_sdk_libcxx_path != '':
if os.path.exists(os.path.join(config.target_sdk_libcxx_path, "span")):
config.available_features.add('std_span')
elif get_target_os() in ['linux-gnu']:
for p in ['/usr/include/c++/', '/usr/local/include/c++/']:
if not os.path.isdir(p):
continue
for subdir in os.listdir(p):
if not subdir.isdigit():
# skip paths libc++ paths like /usr/include/c++/v1, we want libstdc++ paths only (like /usr/include/c++/13)
continue
if os.path.exists(os.path.join(p, subdir, "span")):
config.available_features.add('std_span')
elif get_target_os() in ['windows-msvc']:
# We don't test on any versions of MSVC without std::span support.
# FIXME: figure out where to do lookup for C++ stdlib headers on Windows - we'll probably need it eventually
config.available_features.add('std_span')