diff --git a/CMakeLists.txt b/CMakeLists.txt index 66496958..aa3cdad4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,9 @@ option(USE_BUNDLED_DEPS "Bundle hard to find dependencies into the Falco binary" option(BUILD_WARNINGS_AS_ERRORS "Enable building with -Wextra -Werror flags" OFF) option(USE_BUNDLED_DEPS "Enable bundled dependencies instead of using the system ones" OFF) +# Elapsed time +# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time") # TODO(fntlnz, leodido): add a flag to enable this + # Make flag for parallel processing include(ProcessorCount) processorcount(PROCESSOR_COUNT) @@ -244,16 +247,6 @@ ExternalProject_Add( BUILD_COMMAND ${CMD_MAKE} COPT="-DNO_FILES" WITH_CPP=1 INSTALL_COMMAND ${CMD_MAKE} install-lib install-headers PREFIX=${CIVETWEB_SRC}/install "WITH_CPP=1 OPENSSL_API_1_1") -# c-ares -# TODO(fntlnz, leodido): c-ares is only needed for grpc? In case remove here! -find_path(CARES_INCLUDE NAMES ares.h) -find_library(CARES_LIB NAMES libcares.so) -if(CARES_INCLUDE AND CARES_LIB) - message(STATUS "Found c-ares: include: ${CARES_INCLUDE}, lib: ${CARES_LIB}") -else() - message(FATAL_ERROR "Couldn't find system c-ares") -endif() - # gRPC include(gRPC) diff --git a/cmake/modules/gRPC.cmake b/cmake/modules/gRPC.cmake index 6497b607..1557f213 100644 --- a/cmake/modules/gRPC.cmake +++ b/cmake/modules/gRPC.cmake @@ -21,6 +21,15 @@ if(NOT USE_BUNDLED_DEPS) message(STATUS "Found zlib: include: ${ZLIB_INCLUDE}, lib: ${ZLIB_LIB}") endif() + # c-ares + find_path(CARES_INCLUDE NAMES ares.h) + find_library(CARES_LIB NAMES libcares.so) + if(CARES_INCLUDE AND CARES_LIB) + message(STATUS "Found c-ares: include: ${CARES_INCLUDE}, lib: ${CARES_LIB}") + else() + message(FATAL_ERROR "Couldn't find system c-ares") + endif() + # protobuf find_program(PROTOC NAMES protoc) find_path(PROTOBUF_INCLUDE NAMES google/protobuf/message.h) @@ -55,7 +64,9 @@ if(NOT USE_BUNDLED_DEPS) if(NOT GRPC_CPP_PLUGIN) message(FATAL_ERROR "System grpc_cpp_plugin not found") endif() + else() + find_package(PkgConfig) if(NOT PKG_CONFIG_FOUND) message(FATAL_ERROR "pkg-config binary not found") @@ -89,12 +100,11 @@ else() set(GRPC_BUILD_FLAGS ${PROCESSOUR_COUNT_MAKE_FLAG}) - # "cd ${ZLIB_INCLUDE} && ./configure && make" ExternalProject_Add( grpc GIT_REPOSITORY https://github.com/grpc/grpc.git GIT_TAG v1.8.1 - GIT_SUBMODULES "" + GIT_SUBMODULES "third_party/protobuf third_party/zlib third_party/cares/cares" BUILD_IN_SOURCE 1 BUILD_BYPRODUCTS ${GRPC_LIB} ${GRPCPP_LIB} INSTALL_COMMAND ""