2019-09-23 16:10:53 +08:00
|
|
|
find_package(SYSTEMD REQUIRED)
|
2021-03-08 17:33:17 +08:00
|
|
|
find_package(NFNETLINK REQUIRED)
|
2019-09-23 16:10:53 +08:00
|
|
|
|
2021-03-08 17:33:17 +08:00
|
|
|
add_executable(tfe src/acceptor_kni_v1.cpp src/acceptor_kni_v2.cpp src/acceptor_kni_v3.cpp src/ssl_stream.cpp src/key_keeper.cpp src/ssl_fetch_cert.cpp
|
2019-06-01 17:00:36 +08:00
|
|
|
src/ssl_sess_cache.cpp src/ssl_sess_ticket.cpp src/ssl_service_cache.cpp
|
|
|
|
|
src/ssl_trusted_cert_storage.cpp src/ev_root_ca_metadata.cpp src/ssl_utils.cpp
|
2021-08-20 11:32:33 +08:00
|
|
|
src/tcp_stream.cpp src/main.cpp src/proxy.cpp src/sender_scm.cpp src/watchdog_kni.cpp src/watchdog_tfe.cpp src/ssl_ja3.cpp)
|
2018-08-27 21:10:45 +08:00
|
|
|
|
2018-08-21 16:11:50 +08:00
|
|
|
target_include_directories(tfe PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/external)
|
|
|
|
|
target_include_directories(tfe PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include/internal)
|
2019-09-23 16:10:53 +08:00
|
|
|
target_include_directories(tfe PRIVATE ${SYSTEMD_INCLUDE_DIRS})
|
2018-08-21 16:11:50 +08:00
|
|
|
|
2018-10-14 18:45:02 +08:00
|
|
|
target_link_libraries(tfe common tango-cache-client)
|
2021-03-08 17:33:17 +08:00
|
|
|
target_link_libraries(tfe pthread dl nfnetlink
|
|
|
|
|
libnetfilter_queue-static
|
2018-08-31 19:59:22 +08:00
|
|
|
openssl-ssl-static
|
|
|
|
|
openssl-crypto-static
|
2018-09-27 19:06:57 +08:00
|
|
|
libevent-static
|
2018-08-31 19:59:22 +08:00
|
|
|
libevent-static-openssl
|
|
|
|
|
libevent-static-pthreads
|
|
|
|
|
MESA_handle_logger
|
|
|
|
|
MESA_prof_load
|
2018-09-07 17:42:57 +08:00
|
|
|
cjson
|
2018-10-19 16:00:51 +08:00
|
|
|
libcurl-static
|
2018-10-25 20:40:10 +08:00
|
|
|
hiredis-static
|
2018-08-31 19:59:22 +08:00
|
|
|
MESA_htable wiredcfg
|
2019-08-20 18:41:44 +08:00
|
|
|
MESA_field_stat
|
2020-10-19 12:06:14 +08:00
|
|
|
breakpad_mini
|
2019-09-23 16:10:53 +08:00
|
|
|
${SYSTEMD_LIBRARIES})
|
2018-08-30 15:53:41 +08:00
|
|
|
|
2018-11-16 20:27:36 +08:00
|
|
|
if(ENABLE_PLUGIN_HTTP)
|
|
|
|
|
target_link_libraries(tfe -Wl,--whole-archive http -Wl,--no-whole-archive)
|
|
|
|
|
endif()
|
2018-09-07 17:27:23 +08:00
|
|
|
|
2019-05-27 14:17:52 +08:00
|
|
|
if(ENABLE_PLUGIN_HTTP2)
|
|
|
|
|
target_link_libraries(tfe -Wl,--whole-archive http2 -Wl,--no-whole-archive)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-06-11 17:57:18 +08:00
|
|
|
if(ENABLE_PLUGIN_DOH)
|
|
|
|
|
target_link_libraries(tfe -Wl,--whole-archive doh -Wl,--no-whole-archive)
|
|
|
|
|
endif()
|
|
|
|
|
|
2018-11-16 20:27:36 +08:00
|
|
|
if(ENABLE_PLUGIN_PANGU_HTTP)
|
|
|
|
|
target_link_libraries(tfe -Wl,--whole-archive pangu-http -Wl,--no-whole-archive)
|
|
|
|
|
endif()
|
|
|
|
|
|
2019-05-20 15:08:42 +08:00
|
|
|
if(ENABLE_PLUGIN_SSL_POLICY)
|
|
|
|
|
target_link_libraries(tfe -Wl,--whole-archive ssl-policy -Wl,--no-whole-archive)
|
|
|
|
|
endif()
|
|
|
|
|
|
2019-06-08 19:41:43 +08:00
|
|
|
if(ENABLE_PLUGIN_TRAFFIC_MIRROR)
|
|
|
|
|
target_link_libraries(tfe -Wl,--whole-archive traffic-mirror -Wl,--no-whole-archive)
|
|
|
|
|
endif()
|
2019-05-20 15:08:42 +08:00
|
|
|
|
2018-11-16 20:27:36 +08:00
|
|
|
install(TARGETS tfe RUNTIME DESTINATION bin COMPONENT Program)
|
2018-09-04 15:47:41 +08:00
|
|
|
|
2019-01-16 15:36:28 +06:00
|
|
|
#### test_key_keeper
|
|
|
|
|
#add_executable(test_key_keeper test/test_key_keeper.cpp src/key_keeper.cpp src/ssl_sess_cache.cpp src/ssl_utils.cpp )
|
|
|
|
|
#
|
|
|
|
|
#target_include_directories(test_key_keeper PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include/internal)
|
|
|
|
|
#
|
|
|
|
|
#target_link_libraries(test_key_keeper common)
|
|
|
|
|
#target_link_libraries(test_key_keeper pthread dl
|
|
|
|
|
# openssl-ssl-static
|
|
|
|
|
# openssl-crypto-static
|
|
|
|
|
# pthread libevent-static
|
|
|
|
|
# libevent-static-openssl
|
|
|
|
|
# libevent-static-pthreads
|
|
|
|
|
# MESA_handle_logger
|
|
|
|
|
# MESA_prof_load
|
|
|
|
|
# cjson
|
|
|
|
|
# curl
|
|
|
|
|
# MESA_htable wiredcfg
|
|
|
|
|
# MESA_field_stat)
|
|
|
|
|
#
|
|
|
|
|
#### test_tfe_rpc
|
|
|
|
|
#add_executable(test_tfe_rpc test/test_tfe_rpc.cpp src/key_keeper.cpp src/ssl_sess_cache.cpp src/ssl_utils.cpp)
|
|
|
|
|
#
|
|
|
|
|
#target_include_directories(test_tfe_rpc PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include/internal)
|
|
|
|
|
#
|
|
|
|
|
#target_link_libraries(test_tfe_rpc common)
|
|
|
|
|
#target_link_libraries(test_tfe_rpc pthread dl
|
|
|
|
|
# openssl-ssl-static
|
|
|
|
|
# openssl-crypto-static
|
|
|
|
|
# pthread libevent-static
|
|
|
|
|
# libevent-static-openssl
|
|
|
|
|
# libevent-static-pthreads
|
|
|
|
|
# MESA_handle_logger
|
|
|
|
|
# MESA_prof_load
|
|
|
|
|
# MESA_htable wiredcfg
|
|
|
|
|
# cjson
|
|
|
|
|
# curl
|
|
|
|
|
# MESA_field_stat)
|
|
|
|
|
#
|
|
|
|
|
#### test_chello_parse
|
2019-09-23 16:10:53 +08:00
|
|
|
#add_executable(test_chello_parse test/test_chello_parse.cpp src/ssl_utils.cpp)
|
|
|
|
|
#target_include_directories(test_chello_parse PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include/internal)
|
|
|
|
|
#target_link_libraries(test_chello_parse common)
|
|
|
|
|
#target_link_libraries(test_chello_parse pthread dl
|
|
|
|
|
# openssl-ssl-static
|
|
|
|
|
# openssl-crypto-static
|
|
|
|
|
# pthread libevent-static
|
|
|
|
|
# libevent-static-openssl
|
|
|
|
|
# libevent-static-pthreads
|
|
|
|
|
# MESA_handle_logger
|
|
|
|
|
# MESA_prof_load
|
|
|
|
|
# MESA_htable wiredcfg
|
|
|
|
|
# cjson
|
|
|
|
|
# MESA_field_stat)
|
2019-06-02 15:10:57 +08:00
|
|
|
|
2019-09-23 16:10:53 +08:00
|
|
|
##### test_sender_scm
|
|
|
|
|
#add_executable(test_sender_scm src/sender_scm.cpp test/test_sender_scm.cpp)
|
|
|
|
|
#target_include_directories(test_sender_scm PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include/internal)
|
|
|
|
|
#target_link_libraries(test_sender_scm common)
|
|
|
|
|
#target_link_libraries(test_sender_scm pthread dl MESA_prof_load MESA_handle_logger)
|