aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Hyperscan.cmake
blob: 664ce7312dc9861afac3ff9b35c7a8ffa1d2b5d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
option (ENABLE_HYPERSCAN    "Enable hyperscan for fast regexp processing [default: OFF]" OFF)

if (ENABLE_HYPERSCAN MATCHES "ON")
    ProcessPackage (HYPERSCAN LIBRARY hs INCLUDE hs.h INCLUDE_SUFFIXES
            hs include/hs
            ROOT ${HYPERSCAN_ROOT_DIR} MODULES libhs)
    set (WITH_HYPERSCAN 1)

    # For static linking with Hyperscan we need to link using CXX
    if (ENABLE_HYPERSCAN MATCHES "ON")
        if (${HYPERSCAN_LIBRARY} MATCHES ".*[.]a$" OR STATIC_HYPERSCAN)
            enable_language (CXX)
            set (USE_CXX_LINKER 1)
        endif ()
    endif ()
endif ()