test: allow -target usage on Windows
When running the tests on Windows with a debug build, _DEBUG must be added to the flags prior to the -target as the forced inclusion of a header will prevent the compile test for the flag to fail. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -462,13 +462,17 @@ class Configuration(object):
|
|||||||
gcc_toolchain = self.get_lit_conf('gcc_toolchain')
|
gcc_toolchain = self.get_lit_conf('gcc_toolchain')
|
||||||
if gcc_toolchain:
|
if gcc_toolchain:
|
||||||
self.cxx.flags += ['-gcc-toolchain', gcc_toolchain]
|
self.cxx.flags += ['-gcc-toolchain', gcc_toolchain]
|
||||||
|
# NOTE: the _DEBUG definition must preceed the triple check because for
|
||||||
|
# the Windows build of libc++, the forced inclusion of a header requires
|
||||||
|
# that _DEBUG is defined. Incorrect ordering will result in -target
|
||||||
|
# being elided.
|
||||||
|
if self.is_windows and self.debug_build:
|
||||||
|
self.cxx.compile_flags += ['-D_DEBUG']
|
||||||
if self.use_target:
|
if self.use_target:
|
||||||
if not self.cxx.addFlagIfSupported(
|
if not self.cxx.addFlagIfSupported(
|
||||||
['-target', self.config.target_triple]):
|
['-target', self.config.target_triple]):
|
||||||
self.lit_config.warning('use_target is true but -target is '\
|
self.lit_config.warning('use_target is true but -target is '\
|
||||||
'not supported by the compiler')
|
'not supported by the compiler')
|
||||||
if self.is_windows and self.debug_build:
|
|
||||||
self.cxx.compile_flags += ['-D_DEBUG']
|
|
||||||
|
|
||||||
def configure_compile_flags_header_includes(self):
|
def configure_compile_flags_header_includes(self):
|
||||||
support_path = os.path.join(self.libcxx_src_root, 'test', 'support')
|
support_path = os.path.join(self.libcxx_src_root, 'test', 'support')
|
||||||
|
|||||||
Reference in New Issue
Block a user