summaryrefslogtreecommitdiff
path: root/cmake/config/common.cmake
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-26 15:35:35 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-26 15:53:14 -0200
commit85a095f0a88ef803e1eb98664b83116e2614c4ce (patch)
treefa8ee37c671dc1b041d7c9bec5c4ba992b8b5574 /cmake/config/common.cmake
parent4ed139a49cedf3f6e85d6f631a56bb7e4e416cc6 (diff)
cmake: fix strlcpy() detection and usage.
Linux usually ship with strlcpy(), but it's inside bsd/string.h and needs -lbsd. On BSD it's inside string.h and libc.
Diffstat (limited to '')
-rw-r--r--cmake/config/common.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/config/common.cmake b/cmake/config/common.cmake
index 2e31bf4dd9..be69a892fd 100644
--- a/cmake/config/common.cmake
+++ b/cmake/config/common.cmake
@@ -36,6 +36,7 @@ EFL_OPTION(ENABLE_VALGRIND "Enable valgrind support" "${SUGGEST_VALGRIND}" DEPEN
36 36
37HEADER_CHECK(alloca.h) 37HEADER_CHECK(alloca.h)
38HEADER_CHECK(asm/hwcap.h) 38HEADER_CHECK(asm/hwcap.h)
39HEADER_CHECK(bsd/string.h)
39HEADER_CHECK(dirent.h) 40HEADER_CHECK(dirent.h)
40HEADER_CHECK(execinfo.h) 41HEADER_CHECK(execinfo.h)
41HEADER_CHECK(mcheck.h) 42HEADER_CHECK(mcheck.h)
@@ -80,7 +81,12 @@ FUNC_CHECK(shm_open INCLUDE_FILES sys/mman.h sys/stat.h fcntl.h LIBRARIES rt)
80FUNC_CHECK(siglongjmp INCLUDE_FILES setjmp.h) 81FUNC_CHECK(siglongjmp INCLUDE_FILES setjmp.h)
81FUNC_CHECK(splice INCLUDE_FILES fcntl.h DEFINITIONS "-D_GNU_SOURCE=1") 82FUNC_CHECK(splice INCLUDE_FILES fcntl.h DEFINITIONS "-D_GNU_SOURCE=1")
82FUNC_CHECK(strerror_r INCLUDE_FILES string.h) 83FUNC_CHECK(strerror_r INCLUDE_FILES string.h)
83FUNC_CHECK(strlcpy INCLUDE_FILES bsd/string.h) 84
85if(HAVE_BSD_STRING_H)
86 FUNC_CHECK(strlcpy INCLUDE_FILES bsd/string.h LIBRARIES bsd)
87else()
88 FUNC_CHECK(strlcpy INCLUDE_FILES string.h)
89endif()
84 90
85TYPE_CHECK(siginfo_t INCLUDE_FILES signal.h) 91TYPE_CHECK(siginfo_t INCLUDE_FILES signal.h)
86 92