Make CMake build more compatible with FetchContent
- `HAVE_SSL_IS_QUIC` variable may be used to bypass `check_symbol_exists` call. - it{,prep} targets renamed to nghttp2_it{,prep}
This commit is contained in:
parent
7380ff3551
commit
9712deecc8
|
@ -227,7 +227,7 @@ jobs:
|
|||
if: matrix.buildtool == 'cmake'
|
||||
run: |
|
||||
cd $NGHTTP2_CMAKE_DIR/integration-tests
|
||||
make itprep it
|
||||
make nghttp2_itprep nghttp2_it
|
||||
|
||||
build-cross:
|
||||
strategy:
|
||||
|
|
|
@ -198,6 +198,7 @@ include(CheckSymbolExists)
|
|||
set(HAVE_OPENSSL ${OPENSSL_FOUND})
|
||||
if(OPENSSL_FOUND)
|
||||
set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||
if(NOT (DEFINED HAVE_SSL_IS_QUIC))
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
|
||||
|
@ -205,10 +206,11 @@ if(OPENSSL_FOUND)
|
|||
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" "ws2_32" "bcrypt")
|
||||
endif()
|
||||
check_symbol_exists(SSL_is_quic "openssl/ssl.h" HAVE_SSL_IS_QUIC)
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
if(NOT HAVE_SSL_IS_QUIC)
|
||||
message(WARNING "OpenSSL in ${OPENSSL_LIBRARIES} does not have SSL_is_quic. HTTP/3 support cannot be enabled")
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
else()
|
||||
set(OPENSSL_INCLUDE_DIRS "")
|
||||
set(OPENSSL_LIBRARIES "")
|
||||
|
|
|
@ -18,7 +18,7 @@ set(EXTRA_DIST
|
|||
resp-return.rb
|
||||
)
|
||||
|
||||
add_custom_target(itprep
|
||||
add_custom_target(nghttp2_itprep
|
||||
COMMAND go get -d -v golang.org/x/net/http2
|
||||
COMMAND go get -d -v github.com/tatsuhiro-t/go-nghttp2
|
||||
COMMAND go get -d -v golang.org/x/net/websocket
|
||||
|
@ -40,7 +40,7 @@ if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
|||
endforeach()
|
||||
endif()
|
||||
|
||||
add_custom_target(it
|
||||
add_custom_target(nghttp2_it
|
||||
COMMAND sh setenv go test -v
|
||||
DEPENDS ${GO_BUILD_FILES}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue