mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
cmake: avoid requiring cmake 3.1 on win32 for dns-example
Avoid using target_sources() from cmake 3.1, just pass needable sources as list. (cherry picked from commit 346f8e17080f4649986e0d48176c0a0a5618ea98)
This commit is contained in:
parent
449f5a5746
commit
d2a41a50a8
@ -18,7 +18,7 @@
|
||||
# cmake -G "Visual Studio 10" ..
|
||||
# start libevent.sln
|
||||
#
|
||||
if (WIN32 OR APPLE)
|
||||
if (APPLE)
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
else()
|
||||
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
|
||||
@ -819,6 +819,13 @@ endif()
|
||||
# go away in a future version of Libevent.
|
||||
add_event_library(event SOURCES ${SRC_CORE} ${SRC_EXTRA})
|
||||
|
||||
set(WIN32_GETOPT)
|
||||
if (WIN32)
|
||||
list(APPEND WIN32_GETOPT
|
||||
WIN32-Code/getopt.c
|
||||
WIN32-Code/getopt_long.c)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Samples.
|
||||
#
|
||||
@ -841,7 +848,6 @@ macro(add_sample_prog ssl name)
|
||||
endmacro()
|
||||
if (NOT EVENT__DISABLE_SAMPLES)
|
||||
set(SAMPLES
|
||||
dns-example
|
||||
event-read-fifo
|
||||
hello-world
|
||||
signal-test
|
||||
@ -862,12 +868,7 @@ if (NOT EVENT__DISABLE_SAMPLES)
|
||||
sample/le-proxy.c)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
# requires cmake 3.1
|
||||
target_sources(dns-example PUBLIC
|
||||
WIN32-Code/getopt.c
|
||||
WIN32-Code/getopt_long.c)
|
||||
endif()
|
||||
add_sample_prog(OFF dns-example sample/dns-example.c ${WIN32_GETOPT})
|
||||
endif()
|
||||
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user