mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 04:50:37 -04: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" ..
|
# cmake -G "Visual Studio 10" ..
|
||||||
# start libevent.sln
|
# start libevent.sln
|
||||||
#
|
#
|
||||||
if (WIN32 OR APPLE)
|
if (APPLE)
|
||||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||||
else()
|
else()
|
||||||
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
|
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
|
||||||
@ -819,6 +819,13 @@ endif()
|
|||||||
# go away in a future version of Libevent.
|
# go away in a future version of Libevent.
|
||||||
add_event_library(event SOURCES ${SRC_CORE} ${SRC_EXTRA})
|
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.
|
# Samples.
|
||||||
#
|
#
|
||||||
@ -841,7 +848,6 @@ macro(add_sample_prog ssl name)
|
|||||||
endmacro()
|
endmacro()
|
||||||
if (NOT EVENT__DISABLE_SAMPLES)
|
if (NOT EVENT__DISABLE_SAMPLES)
|
||||||
set(SAMPLES
|
set(SAMPLES
|
||||||
dns-example
|
|
||||||
event-read-fifo
|
event-read-fifo
|
||||||
hello-world
|
hello-world
|
||||||
signal-test
|
signal-test
|
||||||
@ -862,12 +868,7 @@ if (NOT EVENT__DISABLE_SAMPLES)
|
|||||||
sample/le-proxy.c)
|
sample/le-proxy.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
add_sample_prog(OFF dns-example sample/dns-example.c ${WIN32_GETOPT})
|
||||||
# requires cmake 3.1
|
|
||||||
target_sources(dns-example PUBLIC
|
|
||||||
WIN32-Code/getopt.c
|
|
||||||
WIN32-Code/getopt_long.c)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user