diff --git a/bsl/CMakeLists.txt b/bsl/CMakeLists.txt index 3d048dcfeb178b53593beb4253968bd821aa4c23..98cd461b42140fce3ce6d753b653e31a7e21a7f9 100644 --- a/bsl/CMakeLists.txt +++ b/bsl/CMakeLists.txt @@ -1,5 +1,5 @@ -add_custom_target(copy_bsl_headers) -add_custom_command(TARGET copy_bsl_headers +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/ COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include/bsl/ && cp ${CMAKE_CURRENT_LIST_DIR}/*.h ${CMAKE_CURRENT_BINARY_DIR}/include/bsl/ COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include/bsl/utils && cp ${CMAKE_CURRENT_LIST_DIR}/utils/*.h ${CMAKE_CURRENT_BINARY_DIR}/include/bsl/utils COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include/bsl/alloc && cp ${CMAKE_CURRENT_LIST_DIR}/alloc/*.h ${CMAKE_CURRENT_BINARY_DIR}/include/bsl/alloc @@ -13,6 +13,9 @@ add_custom_command(TARGET copy_bsl_headers COMMAND cp ${CMAKE_CURRENT_LIST_DIR}/check_cast/*.h ${CMAKE_CURRENT_BINARY_DIR}/include/bsl COMMAND cp ${CMAKE_CURRENT_LIST_DIR}/ResourcePool/*.h ${CMAKE_CURRENT_BINARY_DIR}/include/bsl/ ) +add_custom_target(copy_bsl_headers + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) add_subdirectory(utils) add_subdirectory(alloc) @@ -26,6 +29,9 @@ add_subdirectory(ResourcePool) add_subdirectory(var/interface) add_subdirectory(var/utils) add_subdirectory(var/implement) -add_custom_target(bsl) +add_library(bsl) add_dependencies(bsl utils alloc archive containers pool buffer exception check_cast ResourcePool interface var_utils implement) +target_link_libraries(bsl + utils archive pool buffer exception check_cast + ResourcePool var_utils implement) diff --git a/configure/constraint/ConstraintFunction.h b/configure/constraint/ConstraintFunction.h index 7357524ef8ec024e7ecf06faead74b64486f2e1f..17067f254a204e98a4099f86bbe7d83166390741 100644 --- a/configure/constraint/ConstraintFunction.h +++ b/configure/constraint/ConstraintFunction.h @@ -55,7 +55,7 @@ namespace comcfg{ virtual int check(const confIDL::cons_func_t&, const confIDL::var_t &, ConfigGroup*, ConfigUnit*); void setLevel(int lv); int getLevel(); - virtual ~ConstraintFunction(); + virtual ~ConstraintFunction() {} }; typedef bsl::hashmap CFMAP_T; @@ -238,7 +238,7 @@ namespace comcfg{ _cf = cf; } WrapFunction(){} - virtual ~WrapFunction(); + virtual ~WrapFunction() {} protected: CF_T _cf; }; diff --git a/predictor/CMakeLists.txt b/predictor/CMakeLists.txt index e017c0152f7a0aea80fd01f9edfa67cc864f8aa7..400546c2170212c9200205b4e416f3ef55ef6f42 100644 --- a/predictor/CMakeLists.txt +++ b/predictor/CMakeLists.txt @@ -16,7 +16,8 @@ set_source_files_properties( ${pdserving_srcs} PROPERTIES COMPILE_FLAGS "-Wno-strict-aliasing -Wno-unused-variable -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor") -add_dependencies(pdserving protobuf boost brpc pdcodegen) +add_dependencies(pdserving protobuf boost brpc leveldb bsl pdcodegen configure + ullib spreg mempool) target_include_directories(pdserving PUBLIC ${CMAKE_CURRENT_LIST_DIR}/ @@ -28,6 +29,24 @@ target_include_directories(pdserving PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../bsl/include) target_link_libraries(pdserving -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) +add_executable(pdserving_exe ${pdserving_srcs}) +set_source_files_properties( + ${pdserving_srcs} + PROPERTIES + COMPILE_FLAGS "-Wno-strict-aliasing -Wno-unused-variable -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor") +add_dependencies(pdserving_exe protobuf boost brpc leveldb bsl pdcodegen + configure ullib spreg mempool) + +target_include_directories(pdserving_exe PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/ + ${CMAKE_CURRENT_BINARY_DIR}/ + ${CMAKE_CURRENT_LIST_DIR}/../configure + ${CMAKE_CURRENT_LIST_DIR}/../mempool + ${CMAKE_CURRENT_LIST_DIR}/../spreg + ${CMAKE_CURRENT_LIST_DIR}/../ullib/include + ${CMAKE_CURRENT_BINARY_DIR}/../bsl/include) +target_link_libraries(pdserving_exe brpc protobuf leveldb bsl configure ullib + spreg mempool -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) add_library(pdclient ${pdclient_srcs}) set_source_files_properties( diff --git a/predictor/common/constant.cpp b/predictor/common/constant.cpp index 310b9bdbf7a22b4b7e00afacf60341e319cb58d1..e7f41ca8c8a5694c99f86e511544898777bcc5da 100644 --- a/predictor/common/constant.cpp +++ b/predictor/common/constant.cpp @@ -28,6 +28,7 @@ DEFINE_int32(reload_interval_s, 10, ""); DEFINE_bool(enable_model_toolkit, false, "enable model toolkit"); DEFINE_string(enable_protocol_list, "baidu_std nshead", "set protocol list"); +const char* START_OP_NAME = "startup_op"; } // predictor } // paddle_serving } // baidu diff --git a/predictor/common/constant.h b/predictor/common/constant.h index e64353e54590d44976b16686c7a9858b0a5c8e32..49db8b935ceca59f0df860dd50d50279628579da 100644 --- a/predictor/common/constant.h +++ b/predictor/common/constant.h @@ -30,7 +30,7 @@ DECLARE_bool(enable_model_toolkit); DECLARE_string(enable_protocol_list); // STATIC Variables -const char* START_OP_NAME = "startup_op"; +extern const char* START_OP_NAME; // ERRORCODE enum { diff --git a/spreg/CMakeLists.txt b/spreg/CMakeLists.txt index 3b4b837da7cf06958e61e74cd7c4b93f2e8cb54e..d466b6cf3323b8ed5cda02d9080609ffe2826ded 100644 --- a/spreg/CMakeLists.txt +++ b/spreg/CMakeLists.txt @@ -1,4 +1,5 @@ FILE(GLOB spreg_srcs ${CMAKE_CURRENT_LIST_DIR}/*.cpp) add_library(spreg ${spreg_srcs}) +add_dependencies(spreg pcre) +target_link_libraries(spreg pcre) include_directories(${CMAKE_CURRENT_LIST_DIR}/include) -message(STATUS ${CMAKE_CURRENT_LIST_DIR}/include)