-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
apt-get install --no-install-recommends --no-install-suggests -y \ | ||
libevent-dev | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# find LibEvent | ||
# an event notification library (http://libevent.org/) | ||
# | ||
# Usage: | ||
# LIBEVENT_INCLUDE_DIRS, where to find LibEvent headers | ||
# LIBEVENT_LIBRARIES, LibEvent libraries | ||
# Libevent_FOUND, If false, do not try to use libevent | ||
# | ||
# Taken from https://github.com/apache/thrift/blob/7edc8faefd391ce11eca3023a35cc54bcb2eb1af/build/cmake/FindLibevent.cmake | ||
# with modification. | ||
|
||
set(LIBEVENT_ROOT CACHE PATH "Root directory of libevent installation") | ||
set(LibEvent_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}" ${LIBEVENT_ROOT}) | ||
foreach(prefix ${LibEvent_EXTRA_PREFIXES}) | ||
list(APPEND LibEvent_INCLUDE_PATHS "${prefix}/include") | ||
list(APPEND LibEvent_LIBRARIES_PATHS "${prefix}/lib") | ||
endforeach() | ||
|
||
# Looking for "event.h" will find the Platform SDK include dir on windows | ||
# so we also look for a peer header like evhttp.h to get the right path | ||
find_path(LIBEVENT_INCLUDE_DIRS evhttp.h event.h PATHS ${LibEvent_INCLUDE_PATHS}) | ||
|
||
# "lib" prefix is needed on Windows in some cases | ||
# newer versions of libevent use three libraries | ||
find_library(LIBEVENT_LIBRARIES NAMES event_core PATHS ${LibEvent_LIBRARIES_PATHS}) | ||
|
||
if (LIBEVENT_LIBRARIES AND LIBEVENT_INCLUDE_DIRS) | ||
set(Libevent_FOUND TRUE) | ||
set(LIBEVENT_LIBRARIES ${LIBEVENT_LIBRARIES}) | ||
else () | ||
set(Libevent_FOUND FALSE) | ||
endif () | ||
|
||
if (Libevent_FOUND) | ||
if (NOT Libevent_FIND_QUIETLY) | ||
message(STATUS "Found libevent: ${LIBEVENT_LIBRARIES}") | ||
endif () | ||
else () | ||
if (LibEvent_FIND_REQUIRED) | ||
message(FATAL_ERROR "Could NOT find libevent.") | ||
endif () | ||
message(STATUS "libevent NOT found.") | ||
endif () | ||
|
||
mark_as_advanced( | ||
LIBEVENT_LIBRARIES | ||
LIBEVENT_INCLUDE_DIRS | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
add_subdirectory(common) | ||
add_subdirectory(event) | ||
add_subdirectory(trace) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if(WITH_LIBEVENT) | ||
add_subdirectory(libevent) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
add_library(opentelemetry_event_libevent | ||
dispatcher.cc | ||
event.cc | ||
event_base.cc | ||
file_event.cc | ||
timer.cc) | ||
target_link_libraries(opentelemetry_event_libevent ${LIBEVENT_LIBRARIES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
add_subdirectory(common) | ||
add_subdirectory(event) | ||
add_subdirectory(trace) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if(WITH_LIBEVENT) | ||
add_subdirectory(libevent) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
foreach(testname dispatcher_test) | ||
add_executable(${testname} "${testname}.cc") | ||
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES} | ||
${CMAKE_THREAD_LIBS_INIT} opentelemetry_event_libevent) | ||
gtest_add_tests(TARGET ${testname} TEST_PREFIX event. TEST_LIST ${testname}) | ||
endforeach() |