From c7c106c3c09ebf11e033dff2d697df5b7e34f819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Sat, 21 Oct 2017 16:02:06 +0200 Subject: [PATCH] [cmake] fix attr header detection and linking --- src/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 535d8438..210ae1a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -233,7 +233,7 @@ macro(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) endmacro(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) if(WITH_XATTR) - check_include_files(attr/attributes.h HAVE_ATTR_ATTRIBUTES_H) + check_include_files("sys/types.h;attr/attributes.h" HAVE_ATTR_ATTRIBUTES_H) if(HAVE_ATTR_ATTRIBUTES_H) check_library_exists(attr attr_get "" HAVE_XATTR) endif() @@ -781,6 +781,10 @@ if(WITH_MEMCACHED) target_link_libraries(mod_trigger_b4_dl memcached) endif() +if(HAVE_XATTR) + target_link_libraries(lighttpd attr) +endif() + if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -g -Wshadow -W -pedantic ${WARN_CFLAGS}") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")