Add basic benchmark (#3038)
* Add basic benchmark * Add basic documentation for how to run and add tests/benchmarks * Update benchmark example output * Add changelog entry Co-authored-by: zneix <zneix@zneix.eu>
This commit is contained in:
+11
-1
@@ -11,6 +11,7 @@ project(chatterino VERSION 2.3.4)
|
||||
|
||||
option(BUILD_APP "Build Chatterino" ON)
|
||||
option(BUILD_TESTS "Build the tests for Chatterino" OFF)
|
||||
option(BUILD_BENCHMARKS "Build the benchmarks for Chatterino" OFF)
|
||||
option(USE_SYSTEM_PAJLADA_SETTINGS "Use system pajlada settings library" OFF)
|
||||
option(USE_SYSTEM_LIBCOMMUNI "Use system communi library" OFF)
|
||||
option(USE_SYSTEM_QTKEYCHAIN "Use system QtKeychain library" OFF)
|
||||
@@ -101,6 +102,11 @@ if (BUILD_TESTS)
|
||||
find_package(GTest REQUIRED)
|
||||
endif ()
|
||||
|
||||
if (BUILD_BENCHMARKS)
|
||||
# Include system benchmark (Google Benchmark)
|
||||
find_package(benchmark REQUIRED)
|
||||
endif ()
|
||||
|
||||
find_package(PajladaSerialize REQUIRED)
|
||||
find_package(PajladaSignals REQUIRED)
|
||||
find_package(LRUCache REQUIRED)
|
||||
@@ -118,7 +124,7 @@ endif()
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if (BUILD_TESTS)
|
||||
if (BUILD_TESTS OR BUILD_BENCHMARKS)
|
||||
add_definitions(-DCHATTERINO_TEST)
|
||||
endif ()
|
||||
|
||||
@@ -129,4 +135,8 @@ if (BUILD_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif ()
|
||||
|
||||
if (BUILD_BENCHMARKS)
|
||||
add_subdirectory(benchmarks)
|
||||
endif ()
|
||||
|
||||
feature_summary(WHAT ALL)
|
||||
|
||||
Reference in New Issue
Block a user