Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
HTTP/3 (ngtcp2 and quiche) and alt-svc support in CMake #5359
autotools leaves a mess in my source directories, obviously I am going to fix CMake support in order to test HTTP/3 changes :-)
I built nghttp3 and ngtcp2 with CMake (the latter requires ngtcp2/ngtcp2#240 - not needed for autotools) and:
The curl+quiche+boringssl build was configured with:
# quiche cargo build -v --release --features pkg-config-meta,qlog mkdir -p deps/boringssl/lib && ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) deps/boringssl/lib/ # curl PKG_CONFIG_PATH=/tmp/quiche/target/release \ cmake -GNinja ~/projects/curl \ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ -DCMAKE_C_FLAGS=-fsanitize=address,undefined \ -DUSE_QUICHE=1 -DENABLE_ALT_SVC=1 \ -DOPENSSL_ROOT_DIR=/tmp/quiche/deps/boringssl \ -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCMAKE_USE_LIBSSH2=OFF
My local build works,
Add three new CMake Find modules (using the curl license, but I grant others the right to apply the CMake BSD license instead). This CMake config is simpler than the autotools one because it assumes ngtcp2 and nghttp3 to be used together. Another difference is that this CMake config checks whether QUIC is actually supported by the TLS library (patched OpenSSL or boringssl) since this can be a common configuration mistake that could result in build errors later. Unlike autotools, CMake does not warn you that the features are experimental. The user is supposed to already know that and read the documentation. It requires a very special build environment anyway. Tested with ngtcp2+OpenSSL+nghttp3 and quiche+boringssl, both built from current git master. Use `LD_DEBUG=files src/curl |& grep need` to figure out which features (libldap-2.4, libssh2) to disable due to conflicts with boringssl.
The quiche_conn_set_qlog_fd check was missing some
If really needed, I could define
I've also managed to get this to build on macOS. This does not require pkg-config unlike the autotools build:
For the record, info about the macOS environment (no custom patches, hence the qlog issue):