Add 'no_default_flags' option for turning off all default test compile and link flags.
When 'no_default_flags' is true only flags passed using '--param=compile_flags' and '--param=link_flags' will be used when compiling the tests. This option can be used to run the test suite against libstdc++ and helps with all unusual test suite configurations. NOTE: sanitizer flags are still added when '--param=use_sanitizer' is used even if '--param=no_default_flags' is given. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226322 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cbc84977aa
commit
ae8bc6b3ef
@ -262,6 +262,14 @@ class Configuration(object):
|
|||||||
self.config.available_features.add('long_tests')
|
self.config.available_features.add('long_tests')
|
||||||
|
|
||||||
def configure_compile_flags(self):
|
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()
|
||||||
|
# Configure extra flags
|
||||||
|
compile_flags_str = self.get_lit_conf('compile_flags', '')
|
||||||
|
self.compile_flags += shlex.split(compile_flags_str)
|
||||||
|
|
||||||
|
def configure_default_compile_flags(self):
|
||||||
# Try and get the std version from the command line. Fall back to
|
# Try and get the std version from the command line. Fall back to
|
||||||
# default given in lit.site.cfg is not present. If default is not
|
# default given in lit.site.cfg is not present. If default is not
|
||||||
# present then force c++11.
|
# present then force c++11.
|
||||||
@ -294,10 +302,6 @@ class Configuration(object):
|
|||||||
' enable_threads is true.')
|
' enable_threads is true.')
|
||||||
# Use verbose output for better errors
|
# Use verbose output for better errors
|
||||||
self.compile_flags += ['-v']
|
self.compile_flags += ['-v']
|
||||||
# Configure extra compile flags.
|
|
||||||
compile_flags_str = self.get_lit_conf('compile_flags', '')
|
|
||||||
self.compile_flags += shlex.split(compile_flags_str)
|
|
||||||
|
|
||||||
sysroot = self.get_lit_conf('sysroot')
|
sysroot = self.get_lit_conf('sysroot')
|
||||||
if sysroot:
|
if sysroot:
|
||||||
self.compile_flags += ['--sysroot', sysroot]
|
self.compile_flags += ['--sysroot', sysroot]
|
||||||
@ -339,6 +343,8 @@ class Configuration(object):
|
|||||||
self.config.available_features.add('libcpp-has-no-monotonic-clock')
|
self.config.available_features.add('libcpp-has-no-monotonic-clock')
|
||||||
|
|
||||||
def configure_link_flags(self):
|
def configure_link_flags(self):
|
||||||
|
no_default_flags = self.get_lit_bool('no_default_flags', False)
|
||||||
|
if not no_default_flags:
|
||||||
self.link_flags += ['-nodefaultlibs']
|
self.link_flags += ['-nodefaultlibs']
|
||||||
|
|
||||||
# Configure library path
|
# Configure library path
|
||||||
|
@ -131,6 +131,16 @@ Note: This does not use the installed headers.
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<h3 class="lit-option">no_default_flags=<bool></h3>
|
||||||
|
<blockquote class="lit-option-desc">
|
||||||
|
<b>Default: </b><code>False</code></br>
|
||||||
|
Disable all default compile and link flags from being added. When this option is
|
||||||
|
used only flags specified using the <code>compile_flags</code> and
|
||||||
|
<code>link_flags</code> will be used.
|
||||||
|
</blockquote>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<h3 class="lit-option">compile_flags="<list-of-args>"</h3>
|
<h3 class="lit-option">compile_flags="<list-of-args>"</h3>
|
||||||
<blockquote class="lit-option-desc">
|
<blockquote class="lit-option-desc">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user