编写CMakeLists编译pangu http

This commit is contained in:
zhengchao
2018-09-14 11:42:22 +08:00
parent 6f11367a64
commit c1dce174f2
5 changed files with 21 additions and 2 deletions

View File

@@ -1 +1,2 @@
add_subdirectory(decrypt-mirroring)
add_subdirectory(pangu-http)

View File

@@ -1,3 +1,5 @@
#include <pangu_logger.h>
#include <tfe_stream.h>
#include <tfe_utils.h>
#include <tfe_http.h>

View File

@@ -1,5 +1,6 @@
#include <tfe_utils.h>
#include <cJSON.h>
#include <cjson/cJSON.h>
#include "pangu_logger.h"
#include <MESA/MESA_handle_logger.h>
#include <MESA/MESA_prof_load.h>
@@ -7,6 +8,8 @@
#include <arpa/inet.h>
#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>

View File

@@ -86,5 +86,5 @@ struct pangu_logger* logger;
//return 0 if SUCCESS, otherwise return -1
int pangu_send_log(struct pangu_logger* logger, const pangu_log* log_msg, struct opt_unit* log_opt, int opt_num);
#endif

13
vendor/CMakeLists.txt vendored
View File

@@ -163,3 +163,16 @@ file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
add_library(cjson SHARED IMPORTED GLOBAL)
set_property(TARGET cjson PROPERTY IMPORTED_LOCATION ${INSTALL_DIR}/lib64/libcjson.so)
set_property(TARGET cjson PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
### librdkafka
ExternalProject_Add(librdkafka PREFIX librdkafka
URL ${CMAKE_CURRENT_SOURCE_DIR}/librdkafka-0.11.5.tar.gz
URL_MD5 90bb43499252317ae55723d32ccacf18
CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR>
BUILD_IN_SOURCE 1)
ExternalProject_Get_Property(librdkafka INSTALL_DIR)
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
add_library(librdkafka-static STATIC IMPORTED GLOBAL)
set_property(TARGET librdkafka-static PROPERTY IMPORTED_LOCATION ${INSTALL_DIR}/lib/librdkafka.a)
set_property(TARGET librdkafka-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)