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:
Jeremy Maitin-Shepard 2022-10-02 14:55:06 -07:00
parent 7380ff3551
commit 9712deecc8
3 changed files with 12 additions and 10 deletions

View File

@ -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:

View File

@ -198,17 +198,19 @@ include(CheckSymbolExists)
set(HAVE_OPENSSL ${OPENSSL_FOUND})
if(OPENSSL_FOUND)
set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
if(WIN32)
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" "ws2_32" "bcrypt")
if(NOT (DEFINED HAVE_SSL_IS_QUIC))
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
if(WIN32)
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()
check_symbol_exists(SSL_is_quic "openssl/ssl.h" HAVE_SSL_IS_QUIC)
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 "")

View File

@ -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}
)