Skip to content
Snippets Groups Projects
Commit b7497c03 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa
Browse files

Fix cmake build

parent 035e45e9
No related merge requests found
...@@ -243,6 +243,7 @@ install(FILES README.rst DESTINATION "${CMAKE_INSTALL_DOCDIR}") ...@@ -243,6 +243,7 @@ install(FILES README.rst DESTINATION "${CMAKE_INSTALL_DOCDIR}")
add_subdirectory(lib) add_subdirectory(lib)
add_subdirectory(tests) add_subdirectory(tests)
add_subdirectory(crypto)
add_subdirectory(third-party) add_subdirectory(third-party)
add_subdirectory(examples) add_subdirectory(examples)
......
# ngtcp2
# Copyright (c) 2019 ngtcp2
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
if(OPENSSL_FOUND)
add_subdirectory(includes)
add_subdirectory(openssl)
else()
message(WARNING "libngtcp2_crypto_openssl library is disabled due to lack of good OpenSSL")
endif()
# ngtcp2
# Copyright (c) 2019 ngtcp2
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
install(FILES
ngtcp2/ngtcp2_crypto.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ngtcp2")
# ngtcp2
# Copyright (c) 2019 ngtcp2
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
add_definitions(-DBUILDING_NGTCP2)
set(ngtcp2_crypto_openssl_SOURCES
openssl.c
../shared.c
)
set(ngtcp2_crypto_openssl_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/lib/includes"
"${CMAKE_BINARY_DIR}/lib/includes"
"${CMAKE_SOURCE_DIR}/lib"
"${CMAKE_SOURCE_DIR}/crypto/includes"
"${CMAKE_BINARY_DIR}/crypto/includes"
"${OPENSSL_INCLUDE_DIRS}"
)
# Public shared library
add_library(ngtcp2_crypto_openssl ${ngtcp2_crypto_openssl_SOURCES})
set_target_properties(ngtcp2_crypto_openssl PROPERTIES
COMPILE_FLAGS "${WARNCFLAGS}"
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
C_VISIBILITY_PRESET hidden
)
target_include_directories(ngtcp2_crypto_openssl PUBLIC
${ngtcp2_crypto_openssl_INCLUDE_DIRS})
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(ngtcp2_crypto_openssl PUBLIC "-DNGTCP2_STATICLIB")
endif()
install(TARGETS ngtcp2_crypto_openssl
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libngtcp2_crypto_openssl.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
...@@ -26,6 +26,7 @@ if(LIBEV_FOUND AND OPENSSL_FOUND AND LIBNGHTTP3_FOUND) ...@@ -26,6 +26,7 @@ if(LIBEV_FOUND AND OPENSSL_FOUND AND LIBNGHTTP3_FOUND)
${CMAKE_SOURCE_DIR}/lib/includes ${CMAKE_SOURCE_DIR}/lib/includes
${CMAKE_BINARY_DIR}/lib/includes ${CMAKE_BINARY_DIR}/lib/includes
${CMAKE_SOURCE_DIR}/third-party ${CMAKE_SOURCE_DIR}/third-party
${CMAKE_SOURCE_DIR}/crypto/includes
${OPENSSL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS}
${LIBEV_INCLUDE_DIRS} ${LIBEV_INCLUDE_DIRS}
...@@ -33,6 +34,7 @@ if(LIBEV_FOUND AND OPENSSL_FOUND AND LIBNGHTTP3_FOUND) ...@@ -33,6 +34,7 @@ if(LIBEV_FOUND AND OPENSSL_FOUND AND LIBNGHTTP3_FOUND)
) )
link_libraries( link_libraries(
ngtcp2_crypto_openssl
ngtcp2 ngtcp2
${OPENSSL_LIBRARIES} ${OPENSSL_LIBRARIES}
${LIBEV_LIBRARIES} ${LIBEV_LIBRARIES}
...@@ -44,8 +46,6 @@ if(LIBEV_FOUND AND OPENSSL_FOUND AND LIBNGHTTP3_FOUND) ...@@ -44,8 +46,6 @@ if(LIBEV_FOUND AND OPENSSL_FOUND AND LIBNGHTTP3_FOUND)
debug.cc debug.cc
util.cc util.cc
keylog.cc keylog.cc
crypto_openssl.cc
crypto.cc
shared.cc shared.cc
) )
...@@ -54,8 +54,6 @@ if(LIBEV_FOUND AND OPENSSL_FOUND AND LIBNGHTTP3_FOUND) ...@@ -54,8 +54,6 @@ if(LIBEV_FOUND AND OPENSSL_FOUND AND LIBNGHTTP3_FOUND)
debug.cc debug.cc
util.cc util.cc
keylog.cc keylog.cc
crypto_openssl.cc
crypto.cc
http.cc http.cc
shared.cc shared.cc
) )
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment