From 2233ef59c99eaf1d07a0ab9c8d1891f6428c02c1 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 24 Dec 2014 16:13:11 -0800 Subject: Include some files based on whether the functions they define are present. Rather than including wsgetopt.c, inet_aton.c, and strptime.c iff we're building for Windows: include wsgetopt.c iff we don't have getopt(); include inet_aton.c iff we don't have inet_aton(); include strptime.c iff we don't have strptime(). Change-Id: Ibd68306ac372a4ae102c3220a94cdf6ecb04e58c Reviewed-on: https://code.wireshark.org/review/6044 Reviewed-by: Guy Harris --- wsutil/CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'wsutil') diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 7a2a19382a..f0595000ac 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -24,11 +24,8 @@ include(UseABICheck) if(WIN32) set(WSUTIL_PLATFORM_FILES file_util.c - inet_aton.c inet_ntop.c inet_pton.c - strptime.c - wsgetopt.c ) ENDIF(WIN32) @@ -88,10 +85,22 @@ if(HAVE_SSE4_2) set(WSUTIL_FILES ${WSUTIL_FILES} ws_mempbrk_sse42.c) endif() +if(NOT HAVE_GETOPT) + set(WSUTIL_FILES ${WSUTIL_FILES} wsgetopt.c) +endif() + +if(NOT HAVE_INET_ATON) + set(WSUTIL_FILES ${WSUTIL_FILES} inet_aton.c) +endif() + if(NOT HAVE_POPCOUNT) set(WSUTIL_FILES ${WSUTIL_FILES} popcount.c) endif() +if(NOT HAVE_STRPTIME) + set(WSUTIL_FILES ${WSUTIL_FILES} strptime.c) +endif() + if(APPLE) # # We assume that APPLE means OS X so that we have the OS X -- cgit v1.2.3