Skip to content

Commit

Permalink
enable libc search in the link testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Nov 27, 2018
1 parent 078bd13 commit 3d91846
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/python/pants/backend/native/tasks/native_compile.py
Expand Up @@ -196,6 +196,7 @@ def _make_compile_argv(self, compile_request):
argv = (
[compiler.exe_filename] +
compiler.extra_args +
# TODO: add -v to every compiler and linker invocation!
# TODO: If we need to produce static libs, don't add -fPIC! (could use Variants -- see #5788).
['-c', '-fPIC'] +
compiler_options +
Expand Down
Expand Up @@ -19,11 +19,17 @@ def task_type(cls):
return LinkSharedLibraries

def test_caching(self):
cpp = self. create_simple_cpp_library(ctypes_native_library=NativeArtifact(lib_name='test'),)
cpp = self.create_simple_cpp_library(ctypes_native_library=NativeArtifact(lib_name='test'),)

cpp_compile_task_type = self.synthesize_task_subtype(CppCompile, 'cpp_compile_scope')
context = self.prepare_context_for_compile(target_roots=[cpp],
for_task_types=[cpp_compile_task_type])
context = self.prepare_context_for_compile(
target_roots=[cpp],
for_task_types=[cpp_compile_task_type],
options={
'libc': {
'enable_libc_search': True,
},
})

cpp_compile = cpp_compile_task_type(context, os.path.join(self.pants_workdir, 'cpp_compile'))
cpp_compile.execute()
Expand Down

0 comments on commit 3d91846

Please sign in to comment.