mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
An old commit (24ae1670d) had the side effect of moving cmake defines after they were being used. This patch move them back to be defined before being used. Speed hsbench back up by ~ 0.8% Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
56 lines
1.4 KiB
CMake
56 lines
1.4 KiB
CMake
include (${CMAKE_MODULE_PATH}/sqlite3.cmake)
|
|
if (NOT SQLITE3_FOUND)
|
|
message(STATUS "sqlite3 not found, not building hsbench")
|
|
return()
|
|
endif()
|
|
|
|
include_directories(SYSTEM ${SQLITE3_INCLUDE_DIRS})
|
|
|
|
|
|
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE")
|
|
set (CMAKE_REQUIRED_LIBRARIES pthread)
|
|
|
|
# only set these after all tests are done
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS}")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}")
|
|
|
|
|
|
SET(hsbench_SOURCES
|
|
common.h
|
|
data_corpus.cpp
|
|
data_corpus.h
|
|
engine.cpp
|
|
engine.h
|
|
engine_hyperscan.cpp
|
|
engine_hyperscan.h
|
|
heapstats.cpp
|
|
heapstats.h
|
|
huge.cpp
|
|
huge.h
|
|
main.cpp
|
|
sqldb.cpp
|
|
sqldb.h
|
|
sqldb_bind.h
|
|
thread_barrier.h
|
|
timer.h
|
|
)
|
|
|
|
if (BUILD_CHIMERA)
|
|
add_definitions(-DHS_HYBRID)
|
|
SET(hsbench_SOURCES
|
|
${hsbench_SOURCES}
|
|
engine_chimera.cpp
|
|
engine_chimera.h
|
|
engine_pcre.cpp
|
|
engine_pcre.h
|
|
)
|
|
add_executable(hsbench ${hsbench_SOURCES})
|
|
include_directories(${PCRE_INCLUDE_DIRS})
|
|
target_link_libraries(hsbench hs chimera ${PCRE_LDFLAGS} databaseutil
|
|
expressionutil ${SQLITE3_LDFLAGS} ${CMAKE_THREAD_LIBS_INIT})
|
|
else()
|
|
add_executable(hsbench ${hsbench_SOURCES})
|
|
target_link_libraries(hsbench hs databaseutil expressionutil
|
|
${SQLITE3_LDFLAGS} ${CMAKE_THREAD_LIBS_INIT})
|
|
endif()
|