Skip to content

Commit 0f55045

Browse files
committed
Pull google/benchmark library to the LLVM tree
This patch pulls google/benchmark v1.4.1 into the LLVM tree so that any project could use it for benchmark generation. A dummy benchmark is added to `llvm/benchmarks/DummyYAML.cpp` to validate the correctness of the build process. The current version does not utilize LLVM LNT and LLVM CMake infrastructure, but that might be sufficient for most users. Two introduced CMake variables: * `LLVM_INCLUDE_BENCHMARKS` (`ON` by default) generates benchmark targets * `LLVM_BUILD_BENCHMARKS` (`OFF` by default) adds generated benchmark targets to the list of default LLVM targets (i.e. if `ON` benchmarks will be built upon standard build invocation, e.g. `ninja` or `make` with no specific targets) List of modifications: * `BENCHMARK_ENABLE_TESTING` is disabled * `BENCHMARK_ENABLE_EXCEPTIONS` is disabled * `BENCHMARK_ENABLE_INSTALL` is disabled * `BENCHMARK_ENABLE_GTEST_TESTS` is disabled * `BENCHMARK_DOWNLOAD_DEPENDENCIES` is disabled Original discussion can be found here: http://lists.llvm.org/pipermail/llvm-dev/2018-August/125023.html Reviewed by: dberris, lebedev.ri Subscribers: ilya-biryukov, ioeric, EricWF, lebedev.ri, srhines, dschuff, mgorny, krytarowski, fedor.sergeev, mgrang, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D50894 llvm-svn: 340809
1 parent b4a8cde commit 0f55045

File tree

106 files changed

+14142
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+14142
-1
lines changed

Diff for: CMakeLists.txt

+17
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,10 @@ option(LLVM_BUILD_TESTS
493493
option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
494494
option(LLVM_INCLUDE_GO_TESTS "Include the Go bindings tests in test build targets." ON)
495495

496+
option(LLVM_BUILD_BENCHMARKS "Add LLVM benchmark targets to the list of default
497+
targets. If OFF, benchmarks still could be built using Benchmarks target." OFF)
498+
option(LLVM_INCLUDE_BENCHMARKS "Generate benchmark targets. If OFF, benchmarks can't be built." ON)
499+
496500
option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
497501
option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
498502
option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
@@ -1013,3 +1017,16 @@ endif()
10131017
if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_INSTALL_UCRT_LIBRARIES)
10141018
include(InstallRequiredSystemLibraries)
10151019
endif()
1020+
1021+
if (LLVM_INCLUDE_BENCHMARKS)
1022+
# Override benchmark defaults so that when the library itself is updated these
1023+
# modifications are not lost.
1024+
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing" FORCE)
1025+
set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "Disable benchmark exceptions" FORCE)
1026+
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Don't install benchmark" FORCE)
1027+
set(BENCHMARK_DOWNLOAD_DEPENDENCIES OFF CACHE BOOL "Don't download dependencies" FORCE)
1028+
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable Google Test in benchmark" FORCE)
1029+
1030+
add_subdirectory(utils/benchmark)
1031+
add_subdirectory(benchmarks)
1032+
endif()

Diff for: benchmarks/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(LLVM_LINK_COMPONENTS
2+
Support)
3+
4+
add_benchmark(DummyYAML DummyYAML.cpp)

Diff for: benchmarks/DummyYAML.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "benchmark/benchmark.h"
2+
#include "llvm/Support/YAMLTraits.h"
3+
4+
static void BM_YAMLDummyIsNumeric(benchmark::State& state) {
5+
std::string x = "hello";
6+
for (auto _ : state) {
7+
std::string copy(x);
8+
llvm::yaml::isNumeric(copy);
9+
}
10+
}
11+
BENCHMARK(BM_YAMLDummyIsNumeric);
12+
13+
BENCHMARK_MAIN();

Diff for: cmake/modules/AddLLVM.cmake

+13-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ function(add_unittest test_suite test_name)
10841084
# Our current version of gtest does not properly recognize C++11 support
10851085
# with MSVC, so it falls back to tr1 / experimental classes. Since LLVM
10861086
# itself requires C++11, we can safely force it on unconditionally so that
1087-
# we don't have to fight with the buggy gtest check.
1087+
# we don't have to fight with the buggy gtest check.
10881088
add_definitions(-DGTEST_LANG_CXX11=1)
10891089
add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
10901090

@@ -1120,6 +1120,18 @@ function(add_unittest test_suite test_name)
11201120
endif ()
11211121
endfunction()
11221122

1123+
# Generic support for adding a benchmark.
1124+
function(add_benchmark benchmark_name)
1125+
if( NOT LLVM_BUILD_BENCHMARKS )
1126+
set(EXCLUDE_FROM_ALL ON)
1127+
endif()
1128+
1129+
add_llvm_executable(${benchmark_name} IGNORE_EXTERNALIZE_DEBUGINFO NO_INSTALL_RPATH ${ARGN})
1130+
set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
1131+
set_output_directory(${benchmark_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
1132+
target_link_libraries(${benchmark_name} PRIVATE benchmark)
1133+
endfunction()
1134+
11231135
function(llvm_add_go_executable binary pkgpath)
11241136
cmake_parse_arguments(ARG "ALL" "" "DEPENDS;GOFLAGS" ${ARGN})
11251137

Diff for: docs/CMake.rst

+6
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ LLVM-specific variables
250250
this option to disable the generation of build targets for the LLVM unit
251251
tests.
252252

253+
**LLVM_BUILD_BENCHMARKS**:BOOL
254+
Adds benchmarks to the list of default targets. Defaults to OFF.
255+
256+
**LLVM_INCLUDE_BENCHMARKS**:BOOL
257+
Generate build targets for the LLVM benchmarks. Defaults to ON.
258+
253259
**LLVM_APPEND_VC_REV**:BOOL
254260
Embed version control revision info (svn revision number or Git revision id).
255261
The version info is provided by the ``LLVM_REVISION`` macro in

Diff for: utils/benchmark/AUTHORS

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This is the official list of benchmark authors for copyright purposes.
2+
# This file is distinct from the CONTRIBUTORS files.
3+
# See the latter for an explanation.
4+
#
5+
# Names should be added to this file as:
6+
# Name or Organization <email address>
7+
# The email address is not required for organizations.
8+
#
9+
# Please keep the list sorted.
10+
11+
Albert Pretorius <[email protected]>
12+
Arne Beer <[email protected]>
13+
Carto
14+
Christopher Seymour <[email protected]>
15+
David Coeurjolly <[email protected]>
16+
Deniz Evrenci <[email protected]>
17+
Dirac Research
18+
Dominik Czarnota <[email protected]>
19+
Eric Fiselier <[email protected]>
20+
Eugene Zhuk <[email protected]>
21+
Evgeny Safronov <[email protected]>
22+
Felix Homann <[email protected]>
23+
Google Inc.
24+
International Business Machines Corporation
25+
Ismael Jimenez Martinez <[email protected]>
26+
Jern-Kuan Leong <[email protected]>
27+
JianXiong Zhou <[email protected]>
28+
Joao Paulo Magalhaes <[email protected]>
29+
Jussi Knuuttila <[email protected]>
30+
Kaito Udagawa <[email protected]>
31+
Kishan Kumar <[email protected]>
32+
33+
Matt Clarkson <[email protected]>
34+
Maxim Vafin <[email protected]>
35+
MongoDB Inc.
36+
Nick Hutchinson <[email protected]>
37+
Oleksandr Sochka <[email protected]>
38+
Paul Redmond <[email protected]>
39+
Radoslav Yovchev <[email protected]>
40+
Roman Lebedev <[email protected]>
41+
Shuo Chen <[email protected]>
42+
Steinar H. Gunderson <[email protected]>
43+
Stripe, Inc.
44+
Yixuan Qiu <[email protected]>
45+
Yusuke Suzuki <[email protected]>
46+
Zbigniew Skowron <[email protected]>

Diff for: utils/benchmark/CMakeLists.txt

+252
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
cmake_minimum_required (VERSION 2.8.12)
2+
3+
project (benchmark)
4+
5+
foreach(p
6+
CMP0054 # CMake 3.1
7+
CMP0056 # export EXE_LINKER_FLAGS to try_run
8+
CMP0057 # Support no if() IN_LIST operator
9+
)
10+
if(POLICY ${p})
11+
cmake_policy(SET ${p} NEW)
12+
endif()
13+
endforeach()
14+
15+
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
16+
option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON)
17+
option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF)
18+
option(BENCHMARK_USE_LIBCXX "Build and test using libc++ as the standard library." OFF)
19+
option(BENCHMARK_BUILD_32_BITS "Build a 32 bit version of the library." OFF)
20+
option(BENCHMARK_ENABLE_INSTALL "Enable installation of benchmark. (Projects embedding benchmark may want to turn this OFF.)" ON)
21+
22+
# Allow unmet dependencies to be met using CMake's ExternalProject mechanics, which
23+
# may require downloading the source code.
24+
option(BENCHMARK_DOWNLOAD_DEPENDENCIES "Allow the downloading and in-tree building of unmet dependencies" OFF)
25+
26+
# This option can be used to disable building and running unit tests which depend on gtest
27+
# in cases where it is not possible to build or find a valid version of gtest.
28+
option(BENCHMARK_ENABLE_GTEST_TESTS "Enable building the unit tests which depend on gtest" OFF)
29+
30+
set(ENABLE_ASSEMBLY_TESTS_DEFAULT OFF)
31+
function(should_enable_assembly_tests)
32+
if(CMAKE_BUILD_TYPE)
33+
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
34+
if (${CMAKE_BUILD_TYPE_LOWER} MATCHES "coverage")
35+
# FIXME: The --coverage flag needs to be removed when building assembly
36+
# tests for this to work.
37+
return()
38+
endif()
39+
endif()
40+
if (MSVC)
41+
return()
42+
elseif(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
43+
return()
44+
elseif(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
45+
# FIXME: Make these work on 32 bit builds
46+
return()
47+
elseif(BENCHMARK_BUILD_32_BITS)
48+
# FIXME: Make these work on 32 bit builds
49+
return()
50+
endif()
51+
find_program(LLVM_FILECHECK_EXE FileCheck)
52+
if (LLVM_FILECHECK_EXE)
53+
set(LLVM_FILECHECK_EXE "${LLVM_FILECHECK_EXE}" CACHE PATH "llvm filecheck" FORCE)
54+
message(STATUS "LLVM FileCheck Found: ${LLVM_FILECHECK_EXE}")
55+
else()
56+
message(STATUS "Failed to find LLVM FileCheck")
57+
return()
58+
endif()
59+
set(ENABLE_ASSEMBLY_TESTS_DEFAULT ON PARENT_SCOPE)
60+
endfunction()
61+
should_enable_assembly_tests()
62+
63+
# This option disables the building and running of the assembly verification tests
64+
option(BENCHMARK_ENABLE_ASSEMBLY_TESTS "Enable building and running the assembly tests"
65+
${ENABLE_ASSEMBLY_TESTS_DEFAULT})
66+
67+
# Make sure we can import out CMake functions
68+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
69+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
70+
71+
72+
# Read the git tags to determine the project version
73+
include(GetGitVersion)
74+
get_git_version(GIT_VERSION)
75+
76+
# Tell the user what versions we are using
77+
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION ${GIT_VERSION})
78+
message("-- Version: ${VERSION}")
79+
80+
# The version of the libraries
81+
set(GENERIC_LIB_VERSION ${VERSION})
82+
string(SUBSTRING ${VERSION} 0 1 GENERIC_LIB_SOVERSION)
83+
84+
# Import our CMake modules
85+
include(CheckCXXCompilerFlag)
86+
include(AddCXXCompilerFlag)
87+
include(CXXFeatureCheck)
88+
89+
if (BENCHMARK_BUILD_32_BITS)
90+
add_required_cxx_compiler_flag(-m32)
91+
endif()
92+
93+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
94+
# Turn compiler warnings up to 11
95+
string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
96+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
97+
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
98+
99+
if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
100+
add_cxx_compiler_flag(-EHs-)
101+
add_cxx_compiler_flag(-EHa-)
102+
endif()
103+
# Link time optimisation
104+
if (BENCHMARK_ENABLE_LTO)
105+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
106+
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
107+
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
108+
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
109+
110+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL")
111+
string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO}")
112+
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
113+
string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}")
114+
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
115+
string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
116+
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
117+
118+
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /GL")
119+
set(CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL "${CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL} /LTCG")
120+
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} /LTCG")
121+
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /LTCG")
122+
endif()
123+
else()
124+
# Try and enable C++11. Don't use C++14 because it doesn't work in some
125+
# configurations.
126+
add_cxx_compiler_flag(-std=c++11)
127+
if (NOT HAVE_CXX_FLAG_STD_CXX11)
128+
add_cxx_compiler_flag(-std=c++0x)
129+
endif()
130+
131+
# Turn compiler warnings up to 11
132+
add_cxx_compiler_flag(-Wall)
133+
134+
add_cxx_compiler_flag(-Wextra)
135+
add_cxx_compiler_flag(-Wshadow)
136+
# FIXME(kbobyrev): Document this change.
137+
# add_cxx_compiler_flag(-Werror RELEASE)
138+
# add_cxx_compiler_flag(-Werror RELWITHDEBINFO)
139+
# add_cxx_compiler_flag(-Werror MINSIZEREL)
140+
add_cxx_compiler_flag(-pedantic)
141+
add_cxx_compiler_flag(-pedantic-errors)
142+
add_cxx_compiler_flag(-Wshorten-64-to-32)
143+
add_cxx_compiler_flag(-Wfloat-equal)
144+
add_cxx_compiler_flag(-fstrict-aliasing)
145+
if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
146+
add_cxx_compiler_flag(-fno-exceptions)
147+
endif()
148+
149+
if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
150+
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") #ICC17u2: Many false positives for Wstrict-aliasing
151+
add_cxx_compiler_flag(-Wstrict-aliasing)
152+
endif()
153+
endif()
154+
# ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially overridden
155+
# (because of deprecated overload)
156+
add_cxx_compiler_flag(-wd654)
157+
add_cxx_compiler_flag(-Wthread-safety)
158+
if (HAVE_CXX_FLAG_WTHREAD_SAFETY)
159+
cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
160+
endif()
161+
162+
# On most UNIX like platforms g++ and clang++ define _GNU_SOURCE as a
163+
# predefined macro, which turns on all of the wonderful libc extensions.
164+
# However g++ doesn't do this in Cygwin so we have to define it ourselfs
165+
# since we depend on GNU/POSIX/BSD extensions.
166+
if (CYGWIN)
167+
add_definitions(-D_GNU_SOURCE=1)
168+
endif()
169+
170+
# Link time optimisation
171+
if (BENCHMARK_ENABLE_LTO)
172+
add_cxx_compiler_flag(-flto)
173+
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
174+
find_program(GCC_AR gcc-ar)
175+
if (GCC_AR)
176+
set(CMAKE_AR ${GCC_AR})
177+
endif()
178+
find_program(GCC_RANLIB gcc-ranlib)
179+
if (GCC_RANLIB)
180+
set(CMAKE_RANLIB ${GCC_RANLIB})
181+
endif()
182+
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
183+
include(llvm-toolchain)
184+
endif()
185+
endif()
186+
187+
# Coverage build type
188+
set(BENCHMARK_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}"
189+
CACHE STRING "Flags used by the C++ compiler during coverage builds."
190+
FORCE)
191+
set(BENCHMARK_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_DEBUG}"
192+
CACHE STRING "Flags used for linking binaries during coverage builds."
193+
FORCE)
194+
set(BENCHMARK_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}"
195+
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
196+
FORCE)
197+
mark_as_advanced(
198+
BENCHMARK_CXX_FLAGS_COVERAGE
199+
BENCHMARK_EXE_LINKER_FLAGS_COVERAGE
200+
BENCHMARK_SHARED_LINKER_FLAGS_COVERAGE)
201+
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
202+
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage.")
203+
add_cxx_compiler_flag(--coverage COVERAGE)
204+
endif()
205+
206+
if (BENCHMARK_USE_LIBCXX)
207+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
208+
add_cxx_compiler_flag(-stdlib=libc++)
209+
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
210+
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
211+
add_cxx_compiler_flag(-nostdinc++)
212+
message("libc++ header path must be manually specified using CMAKE_CXX_FLAGS")
213+
# Adding -nodefaultlibs directly to CMAKE_<TYPE>_LINKER_FLAGS will break
214+
# configuration checks such as 'find_package(Threads)'
215+
list(APPEND BENCHMARK_CXX_LINKER_FLAGS -nodefaultlibs)
216+
# -lc++ cannot be added directly to CMAKE_<TYPE>_LINKER_FLAGS because
217+
# linker flags appear before all linker inputs and -lc++ must appear after.
218+
list(APPEND BENCHMARK_CXX_LIBRARIES c++)
219+
else()
220+
message(FATAL_ERROR "-DBENCHMARK_USE_LIBCXX:BOOL=ON is not supported for compiler")
221+
endif()
222+
endif(BENCHMARK_USE_LIBCXX)
223+
224+
# C++ feature checks
225+
# Determine the correct regular expression engine to use
226+
cxx_feature_check(STD_REGEX)
227+
cxx_feature_check(GNU_POSIX_REGEX)
228+
cxx_feature_check(POSIX_REGEX)
229+
if(NOT HAVE_STD_REGEX AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
230+
message(FATAL_ERROR "Failed to determine the source files for the regular expression backend")
231+
endif()
232+
if (NOT BENCHMARK_ENABLE_EXCEPTIONS AND HAVE_STD_REGEX
233+
AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
234+
message(WARNING "Using std::regex with exceptions disabled is not fully supported")
235+
endif()
236+
cxx_feature_check(STEADY_CLOCK)
237+
# Ensure we have pthreads
238+
find_package(Threads REQUIRED)
239+
240+
# Set up directories
241+
include_directories(${PROJECT_SOURCE_DIR}/include)
242+
243+
# Build the targets
244+
add_subdirectory(src)
245+
246+
if (BENCHMARK_ENABLE_TESTING)
247+
enable_testing()
248+
if (BENCHMARK_ENABLE_GTEST_TESTS)
249+
include(HandleGTest)
250+
endif()
251+
add_subdirectory(test)
252+
endif()

0 commit comments

Comments
 (0)