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