[libcxx-commits] [libcxx] 04c89c7 - [libc++] Centralize where we set the libc++ and libc++abi paths in config.py

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 15 08:45:43 PDT 2020


Author: Louis Dionne
Date: 2020-05-15T11:45:26-04:00
New Revision: 04c89c7fcab4bb3fcdb1e75daa10fd0d8206e320

URL: https://github.com/llvm/llvm-project/commit/04c89c7fcab4bb3fcdb1e75daa10fd0d8206e320
DIFF: https://github.com/llvm/llvm-project/commit/04c89c7fcab4bb3fcdb1e75daa10fd0d8206e320.diff

LOG: [libc++] Centralize where we set the libc++ and libc++abi paths in config.py

It's just confusing to have them all over the place.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 8369a94f1321..b2d802b65da9 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -130,7 +130,9 @@ def configure(self):
         self.configure_src_root()
         self.configure_obj_root()
         self.configure_cxx_stdlib_under_test()
-        self.configure_cxx_library_root()
+        self.cxx_library_root = self.get_lit_conf('cxx_library_root', self.libcxx_obj_root)
+        self.abi_library_root = self.get_lit_conf('abi_library_path', None)
+        self.cxx_runtime_root = self.get_lit_conf('cxx_runtime_root', self.cxx_library_root)
         self.configure_compile_flags()
         self.configure_link_flags()
         self.configure_env()
@@ -168,6 +170,8 @@ def print_config_info(self):
             if k not in os.environ or os.environ[k] != v:
                 show_env_vars[k] = v
         self.lit_config.note('Adding environment variables: %r' % show_env_vars)
+        self.lit_config.note("Linking against the C++ Library at {}".format(self.cxx_library_root))
+        self.lit_config.note("Running against the C++ Library at {}".format(self.cxx_runtime_root))
         sys.stderr.flush()  # Force flushing to avoid broken output on Windows
 
     def get_test_format(self):
@@ -259,12 +263,6 @@ def configure_obj_root(self):
             else:
                 self.libcxx_obj_root = self.project_obj_root
 
-    def configure_cxx_library_root(self):
-        self.cxx_library_root = self.get_lit_conf('cxx_library_root',
-                                                  self.libcxx_obj_root)
-        self.cxx_runtime_root = self.get_lit_conf('cxx_runtime_root',
-                                                   self.cxx_library_root)
-
     def configure_use_system_cxx_lib(self):
         # This test suite supports testing against either the system library or
         # the locally built one; the former mode is useful for testing ABI
@@ -573,7 +571,6 @@ def configure_link_flags_cxx_library_path(self):
 
     def configure_link_flags_abi_library_path(self):
         # Configure ABI library paths.
-        self.abi_library_root = self.get_lit_conf('abi_library_path')
         if self.abi_library_root:
             self.cxx.link_flags += ['-L' + self.abi_library_root]
             if not self.target_info.is_windows():
@@ -589,10 +586,9 @@ def configure_link_flags_cxx_library(self):
         if self.link_shared:
             self.cxx.link_flags += ['-lc++']
         else:
-            cxx_library_root = self.get_lit_conf('cxx_library_root')
-            if cxx_library_root:
+            if self.cxx_library_root:
                 libname = self.make_static_lib_name('c++')
-                abs_path = os.path.join(cxx_library_root, libname)
+                abs_path = os.path.join(self.cxx_library_root, libname)
                 assert os.path.exists(abs_path) and \
                        "static libc++ library does not exist"
                 self.cxx.link_flags += [abs_path]
@@ -615,10 +611,9 @@ def configure_link_flags_abi_library(self):
                 if libcxxabi_shared:
                     self.cxx.link_flags += ['-lc++abi']
                 else:
-                    cxxabi_library_root = self.get_lit_conf('abi_library_path')
-                    if cxxabi_library_root:
+                    if self.abi_library_root:
                         libname = self.make_static_lib_name('c++abi')
-                        abs_path = os.path.join(cxxabi_library_root, libname)
+                        abs_path = os.path.join(self.abi_library_root, libname)
                         self.cxx.link_libcxxabi_flag = abs_path
                         self.cxx.link_flags += [abs_path]
                     else:


        


More information about the libcxx-commits mailing list