Skip to content

Commit

Permalink
libc++ testing: allow to provide a path for use_system_cxx_lib
Browse files Browse the repository at this point in the history
As we're trying to setup testing / bots for all shipping version of libc++
on macOS/iOS, we'll need to be able to pass a path to where to find the
dylib for each previous version of the OS.

Differential Revision: https://reviews.llvm.org/D31486

llvm-svn: 299053
  • Loading branch information
joker-eph committed Mar 30, 2017
1 parent 994e17b commit f029dcd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 16 additions & 5 deletions libcxx/utils/libcxx/test/config.py
Expand Up @@ -273,12 +273,16 @@ def configure_use_system_cxx_lib(self):
# the locally built one; the former mode is useful for testing ABI
# compatibility between the current headers and a shipping dynamic
# library.
self.use_system_cxx_lib = self.get_lit_bool('use_system_cxx_lib')
if self.use_system_cxx_lib is None:
# Default to testing against the locally built libc++ library.
# Default to testing against the locally built libc++ library.
self.use_system_cxx_lib = self.get_lit_conf('use_system_cxx_lib')
if self.use_system_cxx_lib == 'true':
self.use_system_cxx_lib = True
elif self.use_system_cxx_lib == 'false':
self.use_system_cxx_lib = False
self.lit_config.note(
"inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
else:
assert os.path.isdir(self.use_system_cxx_lib)
self.lit_config.note(
"inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)

def configure_cxx_stdlib_under_test(self):
self.cxx_stdlib_under_test = self.get_lit_conf(
Expand Down Expand Up @@ -686,6 +690,13 @@ def configure_link_flags_cxx_library_path(self):
self.cxx_runtime_root]
elif self.is_windows and self.link_shared:
self.add_path(self.exec_env, self.cxx_runtime_root)
elif os.path.isdir(str(self.use_system_cxx_lib)):
self.cxx.link_flags += ['-L' + self.use_system_cxx_lib]
if not self.is_windows:
self.cxx.link_flags += ['-Wl,-rpath,' +
self.use_system_cxx_lib]
if self.is_windows and self.link_shared:
self.add_path(self.cxx.compile_env, self.use_system_cxx_lib)

def configure_link_flags_abi_library_path(self):
# Configure ABI library paths.
Expand Down
2 changes: 2 additions & 0 deletions libcxx/utils/libcxx/test/target_info.py
Expand Up @@ -142,6 +142,8 @@ def configure_env(self, env):
library_paths = []
# Configure the library path for libc++
if self.full_config.use_system_cxx_lib:
if (os.path.isdir(str(self.full_config.use_system_cxx_lib))):
library_paths += [self.full_config.use_system_cxx_lib]
pass
elif self.full_config.cxx_runtime_root:
library_paths += [self.full_config.cxx_runtime_root]
Expand Down

0 comments on commit f029dcd

Please sign in to comment.