Merge pull request #15425 from yaozongyou/fix-build-error

cmake: link against fcgi only if enabled

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-06-02 21:56:03 +08:00 committed by GitHub
commit d5f178f0e5

View File

@ -239,8 +239,12 @@ install(TARGETS rgw DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(WITH_EMBEDDED)
include(MergeStaticLibraries)
add_library(cephd_rgw_base STATIC rgw_main.cc ${radosgw_admin_srcs})
target_include_directories(cephd_rgw_base PUBLIC ${FCGI_INCLUDE_DIR})
if(WITH_RADOSGW_FCGI_FRONTEND)
target_include_directories(cephd_rgw_base PUBLIC ${FCGI_INCLUDE_DIR})
endif()
set_target_properties(cephd_rgw_base PROPERTIES COMPILE_DEFINITIONS BUILDING_FOR_EMBEDDED)
merge_static_libraries(cephd_rgw cephd_rgw_base rgw_a radosgw_a)
target_link_libraries(cephd_rgw ${FCGI_LIBRARY})
if(WITH_RADOSGW_FCGI_FRONTEND)
target_link_libraries(cephd_rgw ${FCGI_LIBRARY})
endif()
endif()