From 9bbce0b63cceb2df9725b30abcf64ee8794cc73e Mon Sep 17 00:00:00 2001 From: Joakim Soderberg Date: Mon, 16 Dec 2013 11:34:14 +0100 Subject: [PATCH] Only include WIN32 getopt where it is used. getopt is only used in the benchmark tests, don't include it in the core lib... --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9977426..a3ced8a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -572,9 +572,7 @@ if(WIN32) bufferevent_async.c event_iocp.c evthread_win32.c - win32select.c - WIN32-Code/getopt.c - WIN32-Code/getopt_long.c + win32select.c ) list(APPEND HDR_PRIVATE WIN32-Code/getopt.h) @@ -651,7 +649,13 @@ endif() if (NOT EVENT__DISABLE_BENCHMARK) foreach (BENCHMARK bench bench_cascade bench_http bench_httpclient) - add_executable(${BENCHMARK} test/${BENCHMARK}.c) + set(BENCH_SRC test/${BENCHMARK}.c) + + if (WIN32) + list(APPEND BENCH_SRC WIN32-Code/getopt.c WIN32-Code/getopt_long.c) + endif() + + add_executable(${BENCHMARK} ${BENCH_SRC}) target_link_libraries(${BENCHMARK} event ${LIB_PLATFORM}) endforeach() endif() -- 2.40.0