[LLVMdev] proposal to avoid zlib dependency.

Dan Liew dan at su-root.co.uk
Wed Sep 17 08:51:30 PDT 2014


On 17 September 2014 16:34, Mueller-Roemer, Johannes Sebastian
<Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de> wrote:
> I'll have another look tomorrow.

Thanks.

> IMO, it is unnecessary clutter. It will fail if ${ZLIB_LIBRARIES} or ${ZLIB_INCLUDE_DIRS} are used anyways as they will be set to NOTFOUND. Or we go back to a silent-fail solution:

Fair enough. I've never been a big fan of silent failure. So perhaps
just this...

```
if (LLVM_ENABLE_ZLIB )
  find_package(ZLIB REQUIRED)
    set(HAVE_ZLIB_H 1)
    set(HAVE_LIBZ 1)
    list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
    list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
else()
  set(HAVE_ZLIB_H 0)
  set(HAVE_LIBZ 0)
endif()
```

-- 
Dan Liew
PhD Student - Imperial College London



More information about the llvm-dev mailing list