[libcxx] r250312 - Split out config_site logic so libc++abi can use it

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 14 12:00:35 PDT 2015


Author: ericwf
Date: Wed Oct 14 14:00:35 2015
New Revision: 250312

URL: http://llvm.org/viewvc/llvm-project?rev=250312&view=rev
Log:
Split out config_site logic so libc++abi can use it

Modified:
    libcxx/trunk/test/libcxx/test/config.py

Modified: libcxx/trunk/test/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/config.py?rev=250312&r1=250311&r2=250312&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/test/config.py (original)
+++ libcxx/trunk/test/libcxx/test/config.py Wed Oct 14 14:00:35 2015
@@ -414,18 +414,7 @@ class Configuration(object):
         support_path = os.path.join(self.libcxx_src_root, 'test/support')
         self.cxx.compile_flags += ['-I' + support_path]
         self.cxx.compile_flags += ['-include', os.path.join(support_path, 'nasty_macros.hpp')]
-        # Check for a possible __config_site in the build directory. We
-        # use this if it exists.
-        config_site_header = os.path.join(self.libcxx_obj_root, '__config_site')
-        if os.path.isfile(config_site_header):
-            contained_macros = self.parse_config_site_and_add_features(
-                config_site_header)
-            self.lit_config.note('Using __config_site header %s with macros: %r'
-                % (config_site_header, contained_macros))
-            # FIXME: This must come after the call to
-            # 'parse_config_site_and_add_features(...)' in order for it to work.
-            self.cxx.compile_flags += ['-include', config_site_header]
-
+        self.configure_config_site_header()
         libcxx_headers = self.get_lit_conf(
             'libcxx_headers', os.path.join(self.libcxx_src_root, 'include'))
         if not os.path.isdir(libcxx_headers):
@@ -433,6 +422,20 @@ class Configuration(object):
                                   % libcxx_headers)
         self.cxx.compile_flags += ['-I' + libcxx_headers]
 
+    def configure_config_site_header(self):
+        # Check for a possible __config_site in the build directory. We
+        # use this if it exists.
+        config_site_header = os.path.join(self.libcxx_obj_root, '__config_site')
+        if not os.path.isfile(config_site_header):
+            return
+        contained_macros = self.parse_config_site_and_add_features(
+            config_site_header)
+        self.lit_config.note('Using __config_site header %s with macros: %r'
+            % (config_site_header, contained_macros))
+        # FIXME: This must come after the call to
+        # 'parse_config_site_and_add_features(...)' in order for it to work.
+        self.cxx.compile_flags += ['-include', config_site_header]
+
     def parse_config_site_and_add_features(self, header):
         """ parse_config_site_and_add_features - Deduce and add the test
             features that that are implied by the #define's in the __config_site




More information about the cfe-commits mailing list