Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
d66d34f9
Commit
d66d34f9
authored
Dec 10, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add libc-ares detection to cmake
parent
264a98d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
1 deletion
+57
-1
CMakeLists.txt
CMakeLists.txt
+10
-0
Makefile.am
Makefile.am
+2
-1
cmake/FindLibcares.cmake
cmake/FindLibcares.cmake
+40
-0
src/CMakeLists.txt
src/CMakeLists.txt
+5
-0
No files found.
CMakeLists.txt
View file @
d66d34f9
...
...
@@ -59,6 +59,7 @@ find_package(PythonInterp)
# Auto-detection of features that can be toggled
find_package
(
OpenSSL 1.0.1
)
find_package
(
Libev 4.11
)
find_package
(
Libcares 1.7.5
)
find_package
(
ZLIB 1.2.3
)
if
(
OPENSSL_FOUND AND LIBEV_FOUND AND ZLIB_FOUND
)
set
(
ENABLE_APP_DEFAULT ON
)
...
...
@@ -207,6 +208,14 @@ if(LIBEVENT_FOUND)
# Must both link the core and openssl libraries.
set
(
LIBEVENT_OPENSSL_LIBRARIES
${
LIBEVENT_LIBRARIES
}
)
endif
()
# libc-ares (for src)
set
(
HAVE_LIBCARES
${
LIBCARES_FOUND
}
)
if
(
LIBCARES_FOUND
)
set
(
LIBCARES_INCLUDE_DIRS
${
LIBCARES_INCLUDE_DIR
}
)
else
()
set
(
LIBCARES_INCLUDE_DIRS
""
)
set
(
LIBCARES_LIBRARIES
""
)
endif
()
# jansson (for src/nghttp, src/deflatehd and src/inflatehd)
set
(
HAVE_JANSSON
${
JANSSON_FOUND
}
)
# libxml2 (for src/nghttp)
...
...
@@ -499,6 +508,7 @@ message(STATUS "summary of build options:
OpenSSL:
${
HAVE_OPENSSL
}
(LIBS='
${
OPENSSL_LIBRARIES
}
')
Libxml2:
${
HAVE_LIBXML2
}
(LIBS='
${
LIBXML2_LIBRARIES
}
')
Libev:
${
HAVE_LIBEV
}
(LIBS='
${
LIBEV_LIBRARIES
}
')
Libc-ares:
${
HAVE_LIBCARES
}
(LIBS='
${
LIBCARES_LIBRARIES
}
')
Libevent(SSL):
${
HAVE_LIBEVENT_OPENSSL
}
(LIBS='
${
LIBEVENT_OPENSSL_LIBRARIES
}
')
Spdylay:
${
HAVE_SPDYLAY
}
(LIBS='
${
SPDYLAY_LIBRARIES
}
')
Jansson:
${
HAVE_JANSSON
}
(LIBS='
${
JANSSON_LIBRARIES
}
')
...
...
Makefile.am
View file @
d66d34f9
...
...
@@ -45,7 +45,8 @@ EXTRA_DIST = nghttpx.conf.sample proxy.pac.sample android-config android-make \
cmake/Version.cmake
\
cmake/FindCython.cmake
\
cmake/FindLibevent.cmake
\
cmake/FindJansson.cmake
cmake/FindJansson.cmake
\
cmake/FindLibcares.cmake
.PHONY
:
clang-format
...
...
cmake/FindLibcares.cmake
0 → 100644
View file @
d66d34f9
# - Try to find libcares
# Once done this will define
# LIBCARES_FOUND - System has libcares
# LIBCARES_INCLUDE_DIRS - The libcares include directories
# LIBCARES_LIBRARIES - The libraries needed to use libcares
find_package
(
PkgConfig QUIET
)
pkg_check_modules
(
PC_LIBCARES QUIET libcares
)
find_path
(
LIBCARES_INCLUDE_DIR
NAMES ares.h
HINTS
${
PC_LIBCARES_INCLUDE_DIRS
}
)
find_library
(
LIBCARES_LIBRARY
NAMES cares
HINTS
${
PC_LIBCARES_LIBRARY_DIRS
}
)
if
(
LIBCARES_INCLUDE_DIR
)
set
(
_version_regex
"^#define[
\t
]+ARES_VERSION_STR[
\t
]+
\"
([^
\"
]+)
\"
.*"
)
file
(
STRINGS
"
${
LIBCARES_INCLUDE_DIR
}
/ares_version.h"
LIBCARES_VERSION REGEX
"
${
_version_regex
}
"
)
string
(
REGEX REPLACE
"
${
_version_regex
}
"
"
\\
1"
LIBCARES_VERSION
"
${
LIBCARES_VERSION
}
"
)
unset
(
_version_regex
)
endif
()
include
(
FindPackageHandleStandardArgs
)
# handle the QUIETLY and REQUIRED arguments and set LIBCARES_FOUND to TRUE
# if all listed variables are TRUE and the requested version matches.
find_package_handle_standard_args
(
Libcares REQUIRED_VARS
LIBCARES_LIBRARY LIBCARES_INCLUDE_DIR
VERSION_VAR LIBCARES_VERSION
)
if
(
LIBCARES_FOUND
)
set
(
LIBCARES_LIBRARIES
${
LIBCARES_LIBRARY
}
)
set
(
LIBCARES_INCLUDE_DIRS
${
LIBCARES_INCLUDE_DIR
}
)
endif
()
mark_as_advanced
(
LIBCARES_INCLUDE_DIR LIBCARES_LIBRARY
)
src/CMakeLists.txt
View file @
d66d34f9
...
...
@@ -19,6 +19,7 @@ include_directories(
${
LIBXML2_INCLUDE_DIRS
}
${
LIBEV_INCLUDE_DIRS
}
${
OPENSSL_INCLUDE_DIRS
}
${
LIBCARES_INCLUDE_DIRS
}
${
JANSSON_INCLUDE_DIRS
}
${
ZLIB_INCLUDE_DIRS
}
)
...
...
@@ -31,6 +32,7 @@ link_libraries(
${
LIBXML2_LIBRARIES
}
${
LIBEV_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
LIBCARES_LIBRARIES
}
${
JANSSON_LIBRARIES
}
${
ZLIB_LIBRARIES
}
${
APP_LIBRARIES
}
...
...
@@ -112,6 +114,9 @@ if(ENABLE_APP)
shrpx_api_downstream_connection.cc
shrpx_health_monitor_downstream_connection.cc
shrpx_exec.cc
shrpx_dns_resolver.cc
shrpx_dual_dns_resolver.cc
shrpx_dns_tracker.cc
xsi_strerror.c
)
if
(
HAVE_SPDYLAY
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment