This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Use cmake `find_package` to search zLib for ClamAV test case
ClosedPublic

Authored by atanasyan on Feb 12 2016, 4:55 AM.

Details

Summary
  • in case of cross-compilation using find_package allows to provide path to target specific libraries using single CMAKE_PREFIX_PATH variable.
  • zLib is manadatory for ClamAV test case so if it does not exist it is better to get know about that early
  • if zLib cannot be found as a standard package we still can use it providing paths to headers and libraries explicitly by CMAKE_xxx_FLAGS variables

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 47793.Feb 12 2016, 4:55 AM
atanasyan retitled this revision from to [test-suite] Use cmake `find_package` to search zLib for ClamAV test case.
atanasyan updated this object.
atanasyan added reviewers: rengolin, MatzeB.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a subscriber: llvm-commits.
MatzeB accepted this revision.Feb 12 2016, 10:57 AM
MatzeB edited edge metadata.

We really should avoid external dependencies in benchmarks in the long term. But this is indeed the right way to deal with that benchmark today. Some comments:

In any way this is simple enough to just commit (there's always post-commit review).

This revision is now accepted and ready to land.Feb 12 2016, 10:57 AM

find_package(ZLIB) uses FindZLIB module to find zLib. In general, as far as I understand if you have FindSOMETHING module you need to use find_package(SOMETHING) to search the corresponding package.

  • I'd just disable the whole benchmark if libz couldn't be found instead of trying anyway.

I am afraid a bit that somebody just copy target specific libz.so and zlib.h to say the single directory. In that case find_package does not find the library. But if we disable the whole benchmark the cmake code becomes shorter. So I modify the script this way and commit. If somebody stumble to this problem we will know how to fix it.

In any way this is simple enough to just commit (there's always post-commit review).

Thanks for review.

This revision was automatically updated to reflect the committed changes.