1
0
Fork 0

SetupSwiftLibraries.cmake requires a global variable libEvent_target. However, while the PKGConfig variant of FindLibEvent.cmake did set this, the Win32 variant did not; therefore CMake would always fail to find libEvent, disabling Swift. Therefore I set this property, restoring proper compilation of Swift on Windows systems.

This commit is contained in:
legoboyvdlp R 2020-10-29 20:46:29 +00:00 committed by James Turner
parent 6d2f1d33d8
commit 6512783996

View file

@ -8,13 +8,13 @@ set(libEvent_target "_no_target_")
if(WIN32)
FIND_PATH(LIBEVENT_INCLUDE_DIR event2/event.h PATH_SUFFIXES include HINTS ${ADDITIONAL_LIBRARY_PATHS})
FIND_LIBRARY(LIBEVENT_LIB NAMES event_core PATH_SUFFIXES lib HINTS ${ADDITIONAL_LIBRARY_PATHS})
if (LIBEVENT_INCLUDE_DIR AND LIBEVENT_LIB)
add_library(libEvent UNKNOWN IMPORTED)
set_target_properties(libEvent PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT_INCLUDE_DIR}"
IMPORTED_LOCATION "${LIBEVENT_LIB}"
)
set(libEvent_target "libEvent")
endif()