From acb02fd69ec66ed0b9cc4022c25d025786337a5a Mon Sep 17 00:00:00 2001 From: liu zhengxi <380185688@qq.com> Date: Tue, 8 Oct 2019 23:12:05 +0800 Subject: [PATCH] add dll to inference capi (#20180) * add dll to inference capi, test=develop * add if win32 in cmakelists, test=develop --- paddle/fluid/inference/capi/CMakeLists.txt | 9 +++++---- paddle/fluid/inference/capi/pd_tensor.cc | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/inference/capi/CMakeLists.txt b/paddle/fluid/inference/capi/CMakeLists.txt index bb3620b530..68e4fb4b1a 100644 --- a/paddle/fluid/inference/capi/CMakeLists.txt +++ b/paddle/fluid/inference/capi/CMakeLists.txt @@ -3,8 +3,9 @@ cc_library(pd_config SRCS pd_config.cc) cc_library(pd_predictor SRCS pd_predictor.cc) cc_library(pd_tensor SRCS pd_tensor.cc) cc_library(pd_c_api SRCS c_api.cc) - cc_library(paddle_fluid_c SRCS c_api.cc DEPS paddle_fluid pd_config pd_predictor pd_tensor pd_c_api) -# (TODO) dll -# cc_library(paddle_fluid_c_shared SHARED SRCS c_api.cc DEPS paddle_fluid pd_config pd_predictor pd_tensor pd_c_api) -# set_target_properties(paddle_fluid_c_shared PROPERTIES OUTPUT_NAME paddle_fluid_c) +cc_library(paddle_fluid_c_shared SHARED SRCS c_api.cc DEPS paddle_fluid pd_config pd_predictor pd_tensor pd_c_api) +set_target_properties(paddle_fluid_c_shared PROPERTIES OUTPUT_NAME paddle_fluid_c) +if(WIN32) + target_link_libraries(paddle_fluid_c_shared shlwapi.lib) +endif() diff --git a/paddle/fluid/inference/capi/pd_tensor.cc b/paddle/fluid/inference/capi/pd_tensor.cc index 9f1b6436fc..8c797fd31d 100644 --- a/paddle/fluid/inference/capi/pd_tensor.cc +++ b/paddle/fluid/inference/capi/pd_tensor.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include #include #include #include "paddle/fluid/inference/capi/c_api.h" -- GitLab