File tree Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -166,11 +166,11 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/proto")
166
166
include_directories ("${CMAKE_CURRENT_BINARY_DIR} /go/pserver/client/c" )
167
167
168
168
set (EXTERNAL_LIBS
169
- ${GFLAGS_LIBRARIES}
170
- ${GLOG_LIBRARIES}
171
- ${CBLAS_LIBRARIES}
172
- ${PROTOBUF_LIBRARY}
173
- ${ZLIB_LIBRARIES}
169
+ gflags
170
+ glog
171
+ cblas
172
+ protobuf
173
+ zlib
174
174
${PYTHON_LIBRARIES}
175
175
)
176
176
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ ENDIF(WIN32)
28
28
INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIR} )
29
29
30
30
ExternalProject_Add (
31
- zlib
31
+ extern_zlib
32
32
${EXTERNAL_PROJECT_LOG_ARGS}
33
33
GIT_REPOSITORY "https://github.com/madler/zlib.git"
34
34
GIT_TAG "v1.2.8"
@@ -49,9 +49,11 @@ ExternalProject_Add(
49
49
-DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE}
50
50
)
51
51
52
+ ADD_LIBRARY (zlib STATIC IMPORTED GLOBAL )
53
+ SET_PROPERTY (TARGET zlib PROPERTY IMPORTED_LOCATION ${ZLIB_LIBRARIES} )
54
+ ADD_DEPENDENCIES (zlib extern_zlib )
55
+
52
56
LIST (APPEND external_project_dependencies zlib )
53
- ADD_LIBRARY (zlib_target STATIC IMPORTED GLOBAL )
54
- SET_PROPERTY (TARGET zlib_target PROPERTY IMPORTED_LOCATION ${ZLIB_LIBRARIES} )
55
57
56
58
IF (WITH_C_API )
57
59
INSTALL (DIRECTORY ${ZLIB_INCLUDE_DIR} DESTINATION third_party/zlib )
Original file line number Diff line number Diff line change @@ -104,7 +104,9 @@ function(merge_static_libs TARGET_NAME)
104
104
foreach (lib ${libs} )
105
105
list (APPEND libs_deps ${${lib}_LIB_DEPENDS} )
106
106
endforeach ()
107
- list (REMOVE_DUPLICATES libs_deps )
107
+ if (libs_deps )
108
+ list (REMOVE_DUPLICATES libs_deps )
109
+ endif ()
108
110
109
111
# To produce a library we need at least one source file.
110
112
# It is created by add_custom_command below and will helps
@@ -191,10 +193,13 @@ function(cc_library TARGET_NAME)
191
193
list (REMOVE_ITEM cc_library_DEPS warpctc )
192
194
add_dependencies (${TARGET_NAME} warpctc )
193
195
endif ()
194
- # Support linking flags: --whole-archive (Linux) / -force_load (MacOS)
195
- target_circle_link_libraries (${TARGET_NAME} ${cc_library_DEPS} )
196
196
if ("${cc_library_DEPS} " MATCHES "ARCHIVE_START" )
197
+ # Support linking flags: --whole-archive (Linux) / -force_load (MacOS).
198
+ # WARNING: Please don't use ARCHIVE_START&ARCHIVE_END if TARGET_NAME will be linked by other libraries.
199
+ target_circle_link_libraries (${TARGET_NAME} ${cc_library_DEPS} )
197
200
list (REMOVE_ITEM cc_library_DEPS ARCHIVE_START ARCHIVE_END )
201
+ else ()
202
+ target_link_libraries (${TARGET_NAME} ${cc_library_DEPS} )
198
203
endif ()
199
204
add_dependencies (${TARGET_NAME} ${cc_library_DEPS} )
200
205
endif ()
You can’t perform that action at this time.
0 commit comments