-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
65 lines (53 loc) · 1.9 KB
/
CMakeLists.txt
File metadata and controls
65 lines (53 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright (c) 2024 Pyarelal Knowles, MIT License
cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_STANDARD 20)
project(decodeless_benchmark)
include(FetchContent)
option(DECODELESS_SEARCH_DEPENDENCIES "Enable searching for dependencies in adjacent directories" OFF)
option(DECODELESS_FETCH_DEPENDENCIES "Enable fetching dependencies with cmake FetchContent" ON)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(googletest)
FetchContent_Declare(
nanobench
GIT_REPOSITORY https://github.com/martinus/nanobench.git
GIT_TAG v4.1.0
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(nanobench)
FetchContent_Declare(
decodeless_offset_ptr
GIT_REPOSITORY https://github.com/decodeless/offset_ptr.git
GIT_TAG 1f87a9d7a8be23b90c06124014f286df91562006
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(decodeless_offset_ptr)
FetchContent_Declare(
decodeless_writer
GIT_REPOSITORY https://github.com/decodeless/writer.git
GIT_TAG af57ca839694a7f3ca70afdfb8bab3420ad833cf
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(decodeless_writer)
enable_testing()
add_executable(decodeless_benchmark
benchmark.cpp
)
target_link_libraries(decodeless_benchmark PRIVATE
decodeless::writer
decodeless::offset_ptr
gtest_main
nanobench
)
if(MSVC)
target_compile_options(decodeless_benchmark PRIVATE /W4 /WX)
target_compile_definitions(decodeless_benchmark PRIVATE WIN32_LEAN_AND_MEAN=1
NOMINMAX)
else()
target_compile_options(decodeless_benchmark PRIVATE -Wall -Wextra -Wpedantic
-Werror)
endif()
#target_compile_options(decodeless_benchmark PRIVATE -g -Og)
#set(CMAKE_VERBOSE_MAKEFILE ON)
include(GoogleTest)
gtest_discover_tests(decodeless_benchmark)