forked from github/server
have cmake determine bsdstring requirement
This commit is contained in:
parent
b297b4d43c
commit
d48b9611e1
5 changed files with 26 additions and 3 deletions
|
@ -11,6 +11,9 @@ if (MSVC)
|
||||||
include(MSVC)
|
include(MSVC)
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
|
|
||||||
|
INCLUDE (CheckSymbolExists)
|
||||||
|
CHECK_SYMBOL_EXISTS(strlcat string.h HAVE_STRLCAT)
|
||||||
|
|
||||||
find_package (SQLite3)
|
find_package (SQLite3)
|
||||||
find_package (BerkeleyDB)
|
find_package (BerkeleyDB)
|
||||||
find_package (Curses)
|
find_package (Curses)
|
||||||
|
|
|
@ -266,6 +266,10 @@ add_test(server test_eressea)
|
||||||
|
|
||||||
install(TARGETS eressea DESTINATION "bin")
|
install(TARGETS eressea DESTINATION "bin")
|
||||||
|
|
||||||
|
if (HAVE_STRLCAT)
|
||||||
|
add_definitions(-DHAVE_BSDSTRING)
|
||||||
|
endif(HAVE_STRLCAT)
|
||||||
|
|
||||||
if (DB_FOUND)
|
if (DB_FOUND)
|
||||||
include_directories (${DB_INCLUDE_DIR})
|
include_directories (${DB_INCLUDE_DIR})
|
||||||
target_link_libraries(convert ${DB_LIBRARIES})
|
target_link_libraries(convert ${DB_LIBRARIES})
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _POSIX_C_SOURCE 200809L
|
/* #define _POSIX_C_SOURCE 200809L
|
||||||
|
*/
|
||||||
#ifndef MAX_PATH
|
#ifndef MAX_PATH
|
||||||
# define MAX_PATH 4096
|
# define MAX_PATH 4096
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3,7 +3,6 @@ project(util C)
|
||||||
SET(_TEST_FILES
|
SET(_TEST_FILES
|
||||||
attrib.test.c
|
attrib.test.c
|
||||||
base36.test.c
|
base36.test.c
|
||||||
bsdstring.test.c
|
|
||||||
# crmessage.test.c
|
# crmessage.test.c
|
||||||
# dice.test.c
|
# dice.test.c
|
||||||
# event.test.c
|
# event.test.c
|
||||||
|
@ -60,6 +59,12 @@ unicode.c
|
||||||
variant.c
|
variant.c
|
||||||
xml.c
|
xml.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF(HAVE_BSDSTRING)
|
||||||
|
SET (_TEST_FILES ${_TEST_FILES} bsdstring.test.c)
|
||||||
|
SET (_FILES ${_FILES} bsdstring.c)
|
||||||
|
ENDIF(HAVE_BSDSTRING)
|
||||||
|
|
||||||
FOREACH(_FILE ${_FILES})
|
FOREACH(_FILE ${_FILES})
|
||||||
LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE})
|
LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE})
|
||||||
ENDFOREACH(_FILE)
|
ENDFOREACH(_FILE)
|
||||||
|
|
|
@ -4,6 +4,17 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
int wrptr(char **ptr, size_t * size, int bytes);
|
int wrptr(char **ptr, size_t * size, int bytes);
|
||||||
|
|
||||||
|
#undef HAVE_STRLCAT
|
||||||
|
#undef HAVE_STRLCPY
|
||||||
|
#undef HAVE_SLPRINTF
|
||||||
|
#ifdef HAVE_BSDSTRING
|
||||||
|
#define HAVE_STRLCAT
|
||||||
|
#define HAVE_SLPRINT
|
||||||
|
#define HAVE_STRLCPY
|
||||||
|
#else
|
||||||
|
#include <string.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRLCPY
|
#ifndef HAVE_STRLCPY
|
||||||
size_t strlcpy(char *dst, const char *src, size_t siz);
|
size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue