Add automatic memmem detction instead of the previous hack
This commit is contained in:
parent
3b6c338ee8
commit
aeb006beb6
@ -26,6 +26,11 @@ find_package(Git)
|
|||||||
find_package(Sqlite3)
|
find_package(Sqlite3)
|
||||||
|
|
||||||
include(TestBigEndian)
|
include(TestBigEndian)
|
||||||
|
include(CheckSymbolExists)
|
||||||
|
|
||||||
|
#Some functions need this to be found
|
||||||
|
add_definitions(-D_GNU_SOURCE)
|
||||||
|
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE")
|
||||||
|
|
||||||
TEST_BIG_ENDIAN(BIGENDIAN)
|
TEST_BIG_ENDIAN(BIGENDIAN)
|
||||||
if (BIGENDIAN)
|
if (BIGENDIAN)
|
||||||
@ -57,6 +62,8 @@ if (MSVC)
|
|||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
check_symbol_exists(memmem string.h HAVE_MEMMEM)
|
||||||
|
|
||||||
include_directories("${PROJECT_SOURCE_DIR}")
|
include_directories("${PROJECT_SOURCE_DIR}")
|
||||||
include_directories(${SQLITE3_INCLUDE_DIRS})
|
include_directories(${SQLITE3_INCLUDE_DIRS})
|
||||||
link_directories(${SQLITE3_LIBRARY_DIRS})
|
link_directories(${SQLITE3_LIBRARY_DIRS})
|
||||||
|
@ -84,11 +84,9 @@
|
|||||||
#define HAVE_GETOPT
|
#define HAVE_GETOPT
|
||||||
#define HAVE_SSIZE_T
|
#define HAVE_SSIZE_T
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#ifndef __HAIKU__
|
|
||||||
#define HAVE_MEMMEM
|
|
||||||
#endif
|
|
||||||
#define HAVE_GETRLIMIT
|
#define HAVE_GETRLIMIT
|
||||||
#endif
|
#endif
|
||||||
|
#cmakedefine HAVE_MEMMEM
|
||||||
|
|
||||||
/* printf support for size_t and uint64_t */
|
/* printf support for size_t and uint64_t */
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
@ -140,7 +138,6 @@
|
|||||||
|
|
||||||
#if ( defined(BSD_LIKE) && !defined(__FreeBSD_kernel__) ) || defined(__sun__)
|
#if ( defined(BSD_LIKE) && !defined(__FreeBSD_kernel__) ) || defined(__sun__)
|
||||||
#undef HAVE_STRNDUP
|
#undef HAVE_STRNDUP
|
||||||
#undef HAVE_MEMMEM
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GETOPT
|
#ifdef HAVE_GETOPT
|
||||||
|
Loading…
Reference in New Issue
Block a user