self.config.available_features.add('long_tests')
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
# default given in lit.site.cfg is not present. If default is not
# present then force c++11.
' enable_threads is true.')
# Use verbose output for better errors
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')
if sysroot:
self.compile_flags += ['--sysroot', sysroot]
self.config.available_features.add('libcpp-has-no-monotonic-clock')
def configure_link_flags(self):
- self.link_flags += ['-nodefaultlibs']
-
- # Configure library path
- self.configure_link_flags_cxx_library_path()
- self.configure_link_flags_abi_library_path()
-
- # Configure libraries
- self.configure_link_flags_cxx_library()
- self.configure_link_flags_abi_library()
- self.configure_extra_library_flags()
+ no_default_flags = self.get_lit_bool('no_default_flags', False)
+ if not no_default_flags:
+ self.link_flags += ['-nodefaultlibs']
+
+ # Configure library path
+ self.configure_link_flags_cxx_library_path()
+ self.configure_link_flags_abi_library_path()
+
+ # Configure libraries
+ self.configure_link_flags_cxx_library()
+ self.configure_link_flags_abi_library()
+ self.configure_extra_library_flags()
link_flags_str = self.get_lit_conf('link_flags', '')
self.link_flags += shlex.split(link_flags_str)
</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>
<h3 class="lit-option">compile_flags="<list-of-args>"</h3>
<blockquote class="lit-option-desc">
Specify additional compile flags as a space delimited string.