[cmake] fix attr header detection and linking

personal/stbuehler/cleanup-build
Stefan Bühler 5 years ago
parent 4634a05c0d
commit c7c106c3c0

@ -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")

Loading…
Cancel
Save