This is an archive of the discontinued LLVM Phabricator instance.

[cfe] [test] Fix detecting LLVM zlib support in stand-alone builds
ClosedPublic

Authored by mgorny on Sep 23 2016, 8:42 AM.

Details

Summary

Fix the test run to declare missing HAVE_LIBZ value in stand-alone builds, using the LLVM_ENABLE_ZLIB that is exported in LLVMConfig.cmake.

When using in-tree builds, HAVE_LIBZ is declared in cmake/config-ix.cmake as a result of LLVM's CMake checks. When building stand-alone, this value is not available and as a result caused clang to wrongly assume that LLVM was built without zlib support.

To fix it, set it to the value of LLVM_ENABLE_ZLIB. While this variable is originally used to control the user preference, LLVM updates its value to 0 if zlib checks fail. Therefore, we can use it to reliably determine whether LLVM was built with zlib support or not.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny updated this revision to Diff 72258.Sep 23 2016, 8:42 AM
mgorny retitled this revision from to [cfe] [test] Fix detecting LLVM zlib support in stand-alone builds.
mgorny updated this object.
mgorny added reviewers: rsmith, beanz, samsonov.
mgorny added a subscriber: cfe-commits.

For the record: I've tested the patch with and without zlib installed, using in-tree and stand-alone builds.

Gentle ping.

Non-gentle ping?

beanz accepted this revision.Nov 1 2016, 1:31 PM
beanz edited edge metadata.

LGTM!

This revision is now accepted and ready to land.Nov 1 2016, 1:31 PM
This revision was automatically updated to reflect the committed changes.