mindspore/cmake/external_libs/libevent.cmake

26 lines
949 B
CMake
Raw Normal View History

2020-09-16 11:01:59 +08:00
set(libevent_CFLAGS "-fstack-protector-all -D_FORTIFY_SOURCE=2 -O2")
2021-01-23 20:20:31 +08:00
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
2020-12-04 17:12:51 +08:00
set(libevent_LDFLAGS "-Wl,-z,now")
2021-01-23 20:20:31 +08:00
endif()
2020-10-16 14:07:50 +08:00
2021-01-23 20:20:31 +08:00
if(ENABLE_GITEE)
2020-10-16 14:07:50 +08:00
set(REQ_URL "https://gitee.com/mirrors/libevent/repository/archive/release-2.1.12-stable.tar.gz")
set(MD5 "c9036513dd9e5b4fa1c81ade23b7ead2")
else()
set(REQ_URL "https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz")
set(MD5 "b5333f021f880fe76490d8a799cd79f4")
2021-01-23 20:20:31 +08:00
endif()
2020-10-16 14:07:50 +08:00
2020-08-18 19:31:57 +08:00
mindspore_add_pkg(libevent
VER 2.1.12
2020-11-24 21:04:04 +08:00
LIBS event event_pthreads event_core
2020-10-16 14:07:50 +08:00
URL ${REQ_URL}
MD5 ${MD5}
2020-08-18 19:31:57 +08:00
CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING=OFF)
include_directories(${libevent_INC})
add_library(mindspore::event ALIAS libevent::event)
add_library(mindspore::event_pthreads ALIAS libevent::event_pthreads)
2020-11-24 21:04:04 +08:00
add_library(mindspore::event_core ALIAS libevent::event_core)