From e76496ce46dc76cb0947dddc14187b513343cce0 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 23 Jan 2011 01:05:20 +0000 Subject: [PATCH] Teach the Lit configuration to actually use the cxx0x setting when constructing compile flags, and to link against the 'rt' library on Linux for clock_gettime and friends. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124052 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/lit.cfg | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/lit.cfg b/test/lit.cfg index 9feeee2f9..d8023fd9e 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -134,16 +134,21 @@ if libcxx_obj_root is not None: else: libcxx_obj_root = "/usr" +# Configure extra compiler flags. +compile_flags = [] +if getattr(config, 'cxx_has_stdcxx0x_flag', False): + compile_flags += ['-std=c++0x'] + # Configure extra libraries. libraries = [] if sys.platform == 'darwin': libraries += ['-lSystem'] if sys.platform == 'linux2': - libraries += ['-lgcc_eh', '-lsupc++', '-lc', '-lm', '-lgcc_s'] + libraries += ['-lgcc_eh', '-lsupc++', '-lc', '-lm', '-lrt', '-lgcc_s'] libraries += ['-Wl,-R', libcxx_obj_root + '/lib'] config.test_format = LibcxxTestFormat(cxx_under_test, - cpp_flags = ['-nostdinc++'] + include_paths, + cpp_flags = ['-nostdinc++'] + compile_flags + include_paths, ld_flags = ['-nodefaultlibs'] + library_paths + ['-lc++'] + libraries) config.target_triple = None