aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-12-24 16:13:11 -0800
committerGuy Harris <guy@alum.mit.edu>2014-12-25 00:13:55 +0000
commit2233ef59c99eaf1d07a0ab9c8d1891f6428c02c1 (patch)
treefab66f6f678bfe4aabb3cc05cf7876e98b910e47 /wsutil
parent153c63d3ffafec2c453a847318eb6562ac034af5 (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/CMakeLists.txt15
1 files changed, 12 insertions, 3 deletions
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