Skip to content
Snippets Groups Projects
Commit d29b9f1b authored by Christian Huitema's avatar Christian Huitema
Browse files

Adding CMake input to facilitate porting to Linux.

parent e412381a
No related merge requests found
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
CMAKE_POLICY(SET CMP0003 NEW) CMAKE_POLICY(SET CMP0003 NEW)
PROJECT(picotls) PROJECT(picoquic)
FIND_PACKAGE(PkgConfig REQUIRED) # FIND_PACKAGE(PkgConfig REQUIRED)
SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}") SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR} deps/cifra/src/ext deps/cifra/src deps/micro-ecc deps/picotest include)
SET(MINICRYPTO_LIBRARY_FILES INCLUDE_DIRECTORIES(picoquic picoquictest)
deps/micro-ecc/uECC.c
deps/cifra/src/aes.c SET(PICOQUIC_LIBRARY_FILES
deps/cifra/src/blockwise.c picoquic/fnv1a.c
deps/cifra/src/chacha20.c picoquic/frames.c
deps/cifra/src/chash.c picoquic/http0dot9.c
deps/cifra/src/curve25519.c picoquic/intformat.c
deps/cifra/src/drbg.c picoquic/logger.c
deps/cifra/src/hmac.c picoquic/newreno.c
deps/cifra/src/gcm.c picoquic/packet.c
deps/cifra/src/gf128.c picoquic/picohash.c
deps/cifra/src/modes.c picoquic/quicctx.c
deps/cifra/src/poly1305.c picoquic/sacks.c
deps/cifra/src/sha256.c) picoquic/sender.c
picoquic/tls_api.c
ADD_LIBRARY(picotls-core lib/picotls.c lib/pembase64.c) picoquic/transport.c
ADD_LIBRARY(picotls-minicrypto ${MINICRYPTO_LIBRARY_FILES} lib/cifra.c lib/uecc.c lib/asn1.c) picoquic/util.c
ADD_EXECUTABLE(test-minicrypto.t ${MINICRYPTO_LIBRARY_FILES} deps/picotest/picotest.c t/picotls.c t/minicrypto.c lib/asn1.c lib/pembase64.c) )
SET(TEST_EXES test-minicrypto.t) SET(PICOQUIC_TEST_LIBRARY_FILES
picoquictest/cnx_creation_test.c
FIND_PACKAGE(OpenSSL) picoquictest/float16test.c
IF (OPENSSL_FOUND AND NOT (OPENSSL_VERSION VERSION_LESS "1.0.1")) picoquictest/fnv1atest.c
MESSAGE(WARNING "Enabling OpenSSL support") picoquictest/hashtest.c
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) picoquictest/http0dot9test.c
ADD_LIBRARY(picotls-openssl lib/openssl.c) picoquictest/intformattest.c
ADD_EXECUTABLE(cli t/cli.c lib/pembase64.c) picoquictest/parseheadertest.c
TARGET_LINK_LIBRARIES(cli picotls-openssl picotls-core ${OPENSSL_LIBRARIES}) picoquictest/pn2pn64test.c
ADD_EXECUTABLE(test-openssl.t ${MINICRYPTO_LIBRARY_FILES} lib/cifra.c lib/uecc.c lib/asn1.c lib/pembase64.c deps/picotest/picotest.c t/picotls.c t/openssl.c) picoquictest/sacktest.c
SET_TARGET_PROPERTIES(test-openssl.t PROPERTIES COMPILE_FLAGS "-DPTLS_MEMORY_DEBUG=1") picoquictest/sim_link.c
TARGET_LINK_LIBRARIES(test-openssl.t ${OPENSSL_LIBRARIES}) picoquictest/stream0_frame_test.c
SET(TEST_EXES ${TEST_EXES} test-openssl.t) picoquictest/tls_api_test.c
ELSE () picoquictest/transport_param_test.c
MESSAGE(WARNING "Disabling OpenSSL support (requires 1.0.1 or newer)") )
ENDIF ()
ADD_LIBRARY(picoquic-core ${PICOQUIC_LIBRARY_FILES})
ADD_CUSTOM_TARGET(check prove --exec '' -v ./*.t DEPENDS ${TEST_EXES})
ADD_LIBRARY(picoquic-test ${PICOQUIC_TEST_LIBRARY_FILES})
IF ("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
TARGET_LINK_LIBRARIES(cli "socket" "nsl") ADD_EXECUTABLE(picoquicdemo picoquicdemo/picoquicdemo.c ${PICOQUIC_LIBRARY_FILES})
ENDIF ()
ADD_EXECUTABLE(picoquicclitest picoquicclitest/picoquicclitest.c ${PICOQUIC_TEST_LIBRARY_FILES} ${PICOQUIC_LIBRARY_FILES})
SET(TEST_EXES picoquicclitest)
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