mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-11-27 05:40:48 +00:00
[libcxx] Remove the no_default_flags LIT configuration
This is part of an ongoing cleanup of the LIT test suite, where I'm trying to reduce the number of configuration options. In this case, the original intent seemed to be running the test suite with libstdc++, but this is now supported by specifying cxx_stdlib_under_test=libstdc++. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2fa05e61c8
commit
3b06e97b93
@ -155,14 +155,6 @@ configuration. Passing the option on the command line will override the default.
|
||||
the default value. Otherwise the default value is True on Windows and False
|
||||
on every other platform.
|
||||
|
||||
.. option:: no_default_flags=<bool>
|
||||
|
||||
**Default**: False
|
||||
|
||||
Disable all default compile and link flags from being added. When this
|
||||
option is used only flags specified using the compile_flags and link_flags
|
||||
will be used.
|
||||
|
||||
.. option:: compile_flags="<list-of-args>"
|
||||
|
||||
Specify additional compile flags as a space delimited string.
|
||||
|
@ -485,13 +485,7 @@ class Configuration(object):
|
||||
self.config.available_features.add("objective-c++")
|
||||
|
||||
def configure_compile_flags(self):
|
||||
no_default_flags = self.get_lit_bool('no_default_flags', False)
|
||||
if not no_default_flags:
|
||||
self.configure_default_compile_flags()
|
||||
# This include is always needed so add so add it regardless of
|
||||
# 'no_default_flags'.
|
||||
support_path = os.path.join(self.libcxx_src_root, 'test/support')
|
||||
self.cxx.compile_flags += ['-I' + support_path]
|
||||
self.configure_default_compile_flags()
|
||||
# Configure extra flags
|
||||
compile_flags_str = self.get_lit_conf('compile_flags', '')
|
||||
self.cxx.compile_flags += shlex.split(compile_flags_str)
|
||||
@ -572,6 +566,10 @@ class Configuration(object):
|
||||
self.cxx.flags += ['-arch', arch]
|
||||
self.cxx.flags += ['-m' + name + '-version-min=' + version]
|
||||
|
||||
# Add includes for support headers used in the tests.
|
||||
support_path = os.path.join(self.libcxx_src_root, 'test/support')
|
||||
self.cxx.compile_flags += ['-I' + support_path]
|
||||
|
||||
# FIXME(EricWF): variant_size.pass.cpp requires a slightly larger
|
||||
# template depth with older Clang versions.
|
||||
self.cxx.addFlagIfSupported('-ftemplate-depth=270')
|
||||
@ -729,35 +727,33 @@ class Configuration(object):
|
||||
|
||||
|
||||
def configure_link_flags(self):
|
||||
no_default_flags = self.get_lit_bool('no_default_flags', False)
|
||||
if not no_default_flags:
|
||||
# Configure library path
|
||||
self.configure_link_flags_cxx_library_path()
|
||||
self.configure_link_flags_abi_library_path()
|
||||
# Configure library path
|
||||
self.configure_link_flags_cxx_library_path()
|
||||
self.configure_link_flags_abi_library_path()
|
||||
|
||||
# Configure libraries
|
||||
if self.cxx_stdlib_under_test == 'libc++':
|
||||
self.cxx.link_flags += ['-nodefaultlibs']
|
||||
# FIXME: Handle MSVCRT as part of the ABI library handling.
|
||||
if self.is_windows:
|
||||
self.cxx.link_flags += ['-nostdlib']
|
||||
self.configure_link_flags_cxx_library()
|
||||
self.configure_link_flags_abi_library()
|
||||
self.configure_extra_library_flags()
|
||||
elif self.cxx_stdlib_under_test == 'libstdc++':
|
||||
enable_fs = self.get_lit_bool('enable_filesystem',
|
||||
default=False)
|
||||
if enable_fs:
|
||||
self.config.available_features.add('c++experimental')
|
||||
self.cxx.link_flags += ['-lstdc++fs']
|
||||
self.cxx.link_flags += ['-lm', '-pthread']
|
||||
elif self.cxx_stdlib_under_test == 'msvc':
|
||||
# FIXME: Correctly setup debug/release flags here.
|
||||
pass
|
||||
elif self.cxx_stdlib_under_test == 'cxx_default':
|
||||
self.cxx.link_flags += ['-pthread']
|
||||
else:
|
||||
self.lit_config.fatal('invalid stdlib under test')
|
||||
# Configure libraries
|
||||
if self.cxx_stdlib_under_test == 'libc++':
|
||||
self.cxx.link_flags += ['-nodefaultlibs']
|
||||
# FIXME: Handle MSVCRT as part of the ABI library handling.
|
||||
if self.is_windows:
|
||||
self.cxx.link_flags += ['-nostdlib']
|
||||
self.configure_link_flags_cxx_library()
|
||||
self.configure_link_flags_abi_library()
|
||||
self.configure_extra_library_flags()
|
||||
elif self.cxx_stdlib_under_test == 'libstdc++':
|
||||
enable_fs = self.get_lit_bool('enable_filesystem',
|
||||
default=False)
|
||||
if enable_fs:
|
||||
self.config.available_features.add('c++experimental')
|
||||
self.cxx.link_flags += ['-lstdc++fs']
|
||||
self.cxx.link_flags += ['-lm', '-pthread']
|
||||
elif self.cxx_stdlib_under_test == 'msvc':
|
||||
# FIXME: Correctly setup debug/release flags here.
|
||||
pass
|
||||
elif self.cxx_stdlib_under_test == 'cxx_default':
|
||||
self.cxx.link_flags += ['-pthread']
|
||||
else:
|
||||
self.lit_config.fatal('invalid stdlib under test')
|
||||
|
||||
link_flags_str = self.get_lit_conf('link_flags', '')
|
||||
self.cxx.link_flags += shlex.split(link_flags_str)
|
||||
|
Loading…
Reference in New Issue
Block a user