-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
47 lines (37 loc) · 1.24 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.16)
project(ada-mimesniff
DESCRIPTION "MIMESNIFF"
LANGUAGES C CXX
VERSION 0.1.0
)
include(GNUInstallDirs)
include(CTest)
include(cmake/mimesniff-flags.cmake)
add_subdirectory(src)
include(cmake/clang-format.cmake)
option(ADA_MIMESNIFF_BENCHMARKS "Build benchmarks" OFF)
# We use Google Benchmark, but it does not build under several 32-bit systems.
if((BUILD_TESTING OR ADA_MIMESNIFF_BENCHMARKS) AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
include(${PROJECT_SOURCE_DIR}/cmake/import.cmake)
import_dependency(simdjson simdjson/simdjson 14d927128ba14e13913fc0e7c2cf538790bd1622)
add_dependency(simdjson)
import_dependency(gtest google/googletest 797b0ad2a3a45608ecf5c67e6e289d377a3521ca)
add_dependency(gtest)
endif()
if (ADA_MIMESNIFF_BENCHMARKS)
message(STATUS "Ada benchmarks enabled.")
add_subdirectory(benchmarks)
else(ADA_MIMESNIFF_BENCHMARKS)
if (is_top_project)
message(STATUS "Ada mimesniff benchmarks disabled. Set ADA_MIMESNIFF_BENCHMARKS=ON to enable them.")
endif()
endif()
if (BUILD_TESTING)
message(STATUS "The tests are enabled.")
add_subdirectory(tests)
else()
if(is_top_project)
message(STATUS "The tests are disabled.")
endif()
endif(BUILD_TESTING)
add_subdirectory(singleheader)