Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ include(njson)
include(yaml-cpp)

if(NOT WIN32
AND NOT APPLE
AND NOT MINIMAL_BUILD
AND NOT EMSCRIPTEN
)
Expand All @@ -184,7 +183,7 @@ if(NOT WIN32
# libcurl
include(curl)

# todo(jasondellaluce,rohith-raju): support webserver for non-linux builds too cpp-httlib
# cpp-httplib (health/metrics webserver; used on all non-Windows Unix, e.g. Linux and macOS)
include(cpp-httplib)
endif()

Expand All @@ -203,10 +202,7 @@ if(USE_GPERFTOOLS)
include(gperftools)
endif()
if(NOT MINIMAL_BUILD)
if(NOT WIN32
AND NOT APPLE
AND NOT EMSCRIPTEN
)
if(NOT WIN32 AND NOT EMSCRIPTEN)
include(cares)
endif()
endif()
Expand Down
21 changes: 13 additions & 8 deletions userspace/falco/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,35 @@ if(NOT WIN32)
target_sources(falco_application PRIVATE outputs_program.cpp outputs_syslog.cpp)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT MINIMAL_BUILD)
if(NOT WIN32 AND NOT EMSCRIPTEN AND NOT MINIMAL_BUILD)
target_sources(falco_application PRIVATE outputs_http.cpp falco_metrics.cpp webserver.cpp)

list(APPEND FALCO_INCLUDE_DIRECTORIES FALCO_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}"
"${CARES_INCLUDE}"
)
list(APPEND FALCO_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}" "${CARES_INCLUDE}")

if(TARGET c-ares)
list(APPEND FALCO_DEPENDENCIES c-ares)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND USE_BUNDLED_CURL)
if(USE_BUNDLED_CURL)
list(APPEND FALCO_DEPENDENCIES curl)
endif()

list(APPEND FALCO_LIBRARIES httplib::httplib "${CURL_LIBRARIES}" "${CARES_LIB}")
if(USE_BUNDLED_OPENSSL)
list(APPEND FALCO_DEPENDENCIES openssl)
endif()

# libcurl (static) and cpp-httplib SSL pull in OpenSSL; falco_engine only links it on Linux.
list(APPEND FALCO_LIBRARIES httplib::httplib "${CURL_LIBRARIES}" "${OPENSSL_LIBRARIES}"
"${CARES_LIB}"
)

target_compile_definitions(falco_application PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
endif()

if(EMSCRIPTEN)
target_compile_options(falco_application PRIVATE "-sDISABLE_EXCEPTION_CATCHING=0")
endif()

target_compile_definitions(falco_application PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)

add_dependencies(falco_application ${FALCO_DEPENDENCIES})

target_link_libraries(falco_application ${FALCO_LIBRARIES})
Expand Down