2019-08-15 06:30:42 +00:00
|
|
|
|
|
|
|
set(MISC_LIBRARIES misc CACHE INTERNAL "misc")
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_SOURCE_DIR}/src
|
|
|
|
)
|
|
|
|
|
|
|
|
if(LINUX)
|
2019-09-02 09:40:16 +00:00
|
|
|
list(APPEND misc_SOURCES
|
2019-08-15 06:30:42 +00:00
|
|
|
# Provide our own copy of strlcpy and strlcat
|
|
|
|
# because they are not included with Linux.
|
|
|
|
${CUSTOM_MISC_DIR}/strlcpy.c
|
|
|
|
${CUSTOM_MISC_DIR}/strlcat.c
|
|
|
|
)
|
2019-09-02 09:40:16 +00:00
|
|
|
|
|
|
|
add_library(misc STATIC
|
2019-08-15 06:30:42 +00:00
|
|
|
${misc_SOURCES}
|
|
|
|
)
|
2019-09-02 09:40:16 +00:00
|
|
|
|
|
|
|
elseif(WIN32 OR CYGWIN) # windows
|
|
|
|
|
|
|
|
list(APPEND misc_SOURCES
|
2019-08-15 06:30:42 +00:00
|
|
|
# There are several string functions found in Linux
|
|
|
|
# but not on Windows. Need to provide our own copy.
|
|
|
|
${CUSTOM_MISC_DIR}/strsep.c
|
|
|
|
${CUSTOM_MISC_DIR}/strtok_r.c
|
|
|
|
${CUSTOM_MISC_DIR}/strcasestr.c
|
|
|
|
${CUSTOM_MISC_DIR}/strlcpy.c
|
|
|
|
${CUSTOM_MISC_DIR}/strlcat.c
|
|
|
|
)
|
2019-09-02 09:40:16 +00:00
|
|
|
|
|
|
|
add_library(misc STATIC
|
2019-08-15 06:30:42 +00:00
|
|
|
${misc_SOURCES}
|
|
|
|
)
|
2019-09-02 09:40:16 +00:00
|
|
|
|
2019-08-15 06:30:42 +00:00
|
|
|
else()
|
2019-09-02 09:40:16 +00:00
|
|
|
|
2019-08-15 06:30:42 +00:00
|
|
|
# on macOS, OpenBSD and FreeBSD not misc is necessary
|
|
|
|
set(MISC_LIBRARIES "" CACHE INTERNAL "")
|
2019-09-02 09:40:16 +00:00
|
|
|
|
2019-08-15 06:30:42 +00:00
|
|
|
endif()
|