| 1 |
# ngtcp2 |
| 2 |
|
| 3 |
# Copyright (c) 2020 ngtcp2 |
| 4 |
|
| 5 |
# Permission is hereby granted, free of charge, to any person obtaining |
| 6 |
# a copy of this software and associated documentation files (the |
| 7 |
# "Software"), to deal in the Software without restriction, including |
| 8 |
# without limitation the rights to use, copy, modify, merge, publish, |
| 9 |
# distribute, sublicense, and/or sell copies of the Software, and to |
| 10 |
# permit persons to whom the Software is furnished to do so, subject to |
| 11 |
# the following conditions: |
| 12 |
|
| 13 |
# The above copyright notice and this permission notice shall be |
| 14 |
# included in all copies or substantial portions of the Software. |
| 15 |
|
| 16 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 |
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 |
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 19 |
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| 20 |
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 21 |
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 22 |
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 23 |
|
| 24 |
add_definitions(-DBUILDING_NGTCP2) |
| 25 |
|
| 26 |
set(ngtcp2_crypto_boringssl_SOURCES |
| 27 |
boringssl.c |
| 28 |
../shared.c |
| 29 |
) |
| 30 |
|
| 31 |
set(ngtcp2_crypto_boringssl_INCLUDE_DIRS |
| 32 |
"${CMAKE_CURRENT_SOURCE_DIR}/../../lib/includes" |
| 33 |
"${CMAKE_CURRENT_BINARY_DIR}/../../lib/includes" |
| 34 |
"${CMAKE_CURRENT_SOURCE_DIR}/../../lib" |
| 35 |
"${CMAKE_CURRENT_SOURCE_DIR}/../../crypto/includes" |
| 36 |
"${CMAKE_CURRENT_BINARY_DIR}/../../crypto/includes" |
| 37 |
"${CMAKE_CURRENT_SOURCE_DIR}/../../crypto" |
| 38 |
"${CMAKE_CURRENT_BINARY_DIR}/../../crypto" |
| 39 |
"${BORINGSSL_INCLUDE_DIRS}" |
| 40 |
) |
| 41 |
|
| 42 |
foreach(name libngtcp2_crypto_boringssl.pc) |
| 43 |
configure_file("${name}.in" "${name}" @ONLY) |
| 44 |
endforeach() |
| 45 |
|
| 46 |
if(ENABLE_STATIC_LIB) |
| 47 |
# Public static library |
| 48 |
add_library(ngtcp2_crypto_boringssl_static STATIC ${ngtcp2_crypto_boringssl_SOURCES}) |
| 49 |
set_target_properties(ngtcp2_crypto_boringssl_static PROPERTIES |
| 50 |
COMPILE_FLAGS "${WARNCFLAGS}" |
| 51 |
ARCHIVE_OUTPUT_NAME ngtcp2_crypto_boringssl${STATIC_LIB_SUFFIX} |
| 52 |
C_VISIBILITY_PRESET hidden |
| 53 |
) |
| 54 |
target_compile_definitions(ngtcp2_crypto_boringssl_static PUBLIC |
| 55 |
"-DNGTCP2_STATICLIB") |
| 56 |
target_include_directories(ngtcp2_crypto_boringssl_static PUBLIC |
| 57 |
${ngtcp2_crypto_boringssl_INCLUDE_DIRS}) |
| 58 |
|
| 59 |
install(TARGETS ngtcp2_crypto_boringssl_static |
| 60 |
DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
| 61 |
endif() |
| 62 |
|
| 63 |
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libngtcp2_crypto_boringssl.pc" |
| 64 |
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") |