From 0d3f16f53e05d5139705cab3374c59d0ee5562bd Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Mon, 29 Jul 2019 22:35:42 +0800 Subject: [PATCH] Try to modify external gflags to solve CI compilation (#18872) --- cmake/external/gflags.cmake | 5 +++++ paddle/fluid/platform/dynload/CMakeLists.txt | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/external/gflags.cmake b/cmake/external/gflags.cmake index 343b7544788..fae1e20d3be 100644 --- a/cmake/external/gflags.cmake +++ b/cmake/external/gflags.cmake @@ -21,6 +21,8 @@ IF(WIN32) set(GFLAGS_LIBRARIES "${GFLAGS_INSTALL_DIR}/lib/gflags_static.lib" CACHE FILEPATH "GFLAGS_LIBRARIES" FORCE) ELSE(WIN32) set(GFLAGS_LIBRARIES "${GFLAGS_INSTALL_DIR}/lib/libgflags.a" CACHE FILEPATH "GFLAGS_LIBRARIES" FORCE) + set(BUILD_COMMAND $(MAKE) --silent) + set(INSTALL_COMMAND $(MAKE) install) ENDIF(WIN32) INCLUDE_DIRECTORIES(${GFLAGS_INCLUDE_DIR}) @@ -31,6 +33,8 @@ ExternalProject_Add( GIT_REPOSITORY "https://github.com/gflags/gflags.git" GIT_TAG 77592648e3f3be87d6c7123eb81cbad75f9aef5a PREFIX ${GFLAGS_SOURCES_DIR} + BUILD_COMMAND ${BUILD_COMMAND} + INSTALL_COMMAND ${INSTALL_COMMAND} UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} @@ -50,6 +54,7 @@ ExternalProject_Add( -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE} ) + ADD_LIBRARY(gflags STATIC IMPORTED GLOBAL) SET_PROPERTY(TARGET gflags PROPERTY IMPORTED_LOCATION ${GFLAGS_LIBRARIES}) ADD_DEPENDENCIES(gflags extern_gflags) diff --git a/paddle/fluid/platform/dynload/CMakeLists.txt b/paddle/fluid/platform/dynload/CMakeLists.txt index 4bca4362f0a..2b63c81859d 100644 --- a/paddle/fluid/platform/dynload/CMakeLists.txt +++ b/paddle/fluid/platform/dynload/CMakeLists.txt @@ -1,5 +1,4 @@ cc_library(dynamic_loader SRCS dynamic_loader.cc DEPS glog gflags enforce) -target_link_libraries(dynamic_loader glog gflags enforce) list(APPEND CUDA_SRCS cublas.cc cudnn.cc curand.cc) -- GitLab