CMakeLists.txt revision b1a7c3f9
1# Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc.  See LICENSE.
2SET(lsquic_STAT_SRCS
3    ls-qpack/lsqpack.c
4    lsquic_adaptive_cc.c
5    lsquic_alarmset.c
6    lsquic_arr.c
7    lsquic_attq.c
8    lsquic_bbr.c
9    lsquic_bw_sampler.c
10    lsquic_cfcw.c
11    lsquic_chsk_stream.c
12    lsquic_conn.c
13    lsquic_crand.c
14    lsquic_crt_compress.c
15    lsquic_crypto.c
16    lsquic_cubic.c
17    lsquic_di_error.c
18    lsquic_di_hash.c
19    lsquic_di_nocopy.c
20    lsquic_enc_sess_common.c
21    lsquic_enc_sess_ietf.c
22    lsquic_eng_hist.c
23    lsquic_engine.c
24    lsquic_ev_log.c
25    lsquic_frab_list.c
26    lsquic_frame_common.c
27    lsquic_frame_reader.c
28    lsquic_frame_writer.c
29    lsquic_full_conn.c
30    lsquic_full_conn_ietf.c
31    lsquic_global.c
32    lsquic_handshake.c
33    lsquic_hash.c
34    lsquic_hcsi_reader.c
35    lsquic_hcso_writer.c
36    lsquic_headers_stream.c
37    lsquic_hkdf.c
38    lsquic_hspack_valid.c
39    lsquic_http1x_if.c
40    lsquic_logger.c
41    lsquic_malo.c
42    lsquic_min_heap.c
43    lsquic_mini_conn.c
44    lsquic_mini_conn_ietf.c
45    lsquic_minmax.c
46    lsquic_mm.c
47    lsquic_pacer.c
48    lsquic_packet_common.c
49    lsquic_packet_gquic.c
50    lsquic_packet_in.c
51    lsquic_packet_out.c
52    lsquic_packet_resize.c
53    lsquic_packints.c
54    lsquic_parse_Q046.c
55    lsquic_parse_Q050.c
56    lsquic_parse_common.c
57    lsquic_parse_gquic_be.c
58    lsquic_parse_gquic_common.c
59    lsquic_parse_ietf_v1.c
60    lsquic_parse_iquic_common.c
61    lsquic_pr_queue.c
62    lsquic_purga.c
63    lsquic_qdec_hdl.c
64    lsquic_qenc_hdl.c
65    lsquic_qlog.c
66    lsquic_rechist.c
67    lsquic_rtt.c
68    lsquic_send_ctl.c
69    lsquic_senhist.c
70    lsquic_set.c
71    lsquic_sfcw.c
72    lsquic_shsk_stream.c
73    lsquic_spi.c
74    lsquic_stock_shi.c
75    lsquic_str.c
76    lsquic_stream.c
77    lsquic_tokgen.c
78    lsquic_trans_params.c
79    lsquic_util.c
80    lsquic_varint.c
81    lsquic_version.c
82)
83
84IF(NOT MSVC)
85set_source_files_properties(ls-qpack/lsqpack.c PROPERTIES COMPILE_FLAGS -Wno-uninitialized)
86ENDIF()
87
88include_directories(ls-qpack)
89
90IF(PROJECT_NAME STREQUAL "openlitespeed")
91    INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/spdy)
92ELSE()
93    INCLUDE_DIRECTORIES(../lshpack)
94    SET(lsquic_STAT_SRCS ${lsquic_STAT_SRCS}
95        lsquic_xxhash.c
96        ../lshpack/lshpack.c
97    )
98ENDIF()
99
100ADD_CUSTOM_COMMAND(
101    OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/lsquic_versions_to_string.c
102    COMMAND ${PERL}
103    ARGS ${CMAKE_CURRENT_SOURCE_DIR}/gen-verstrs.pl ${CMAKE_CURRENT_SOURCE_DIR}/../../include/lsquic.h ${CMAKE_CURRENT_SOURCE_DIR}/lsquic_versions_to_string.c
104    DEPENDS ./gen-verstrs.pl ${CMAKE_CURRENT_SOURCE_DIR}/../../include/lsquic.h
105)
106SET(lsquic_STAT_SRCS ${lsquic_STAT_SRCS} lsquic_versions_to_string.c)
107
108SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXXH_HEADER_NAME=\\\"lsquic_xxhash.h\\\"")
109SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLSQPACK_ENC_LOGGER_HEADER=\\\"lsquic_qpack_enc_logger.h\\\"")
110SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLSQPACK_DEC_LOGGER_HEADER=\\\"lsquic_qpack_dec_logger.h\\\"")
111
112add_library(lsquic STATIC ${lsquic_STAT_SRCS} )
113
114