make h2olog dependency detection to be clearer
@@ -859,10 +859,8 @@ ENDIF ()
# h2olog
# If BCC is installed to a non-default directory,
# set something like `PKG_CONFIG_PATH=/path/to/bcc/lib/pkgconfig cmake ...`
-IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- IF (PKG_CONFIG_FOUND)
+IF (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(LIBBCC libbcc)
- ENDIF (PKG_CONFIG_FOUND)
EXECUTE_PROCESS(
COMMAND uname -r
@@ -875,11 +873,11 @@ IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
SET(HAVE_BPF_SUPPORTED_KERNEL ON)
MESSAGE(STATUS "Checking Linux kernel version ${KERNEL_VERSION} >= ${REQUIRED_KERNEL_VERSION} for h2olog - OK")
ENDIF ()
-ENDIF ()
IF (WITH_DTRACE AND LIBBCC_FOUND AND HAVE_BPF_SUPPORTED_KERNEL)
SET(WITH_H2OLOG_DEFAULT ON)
ENDIF ()
+ENDIF ()
OPTION(WITH_H2OLOG "use h2olog command" ${WITH_H2OLOG_DEFAULT})
IF (WITH_H2OLOG)
