aboutsummaryrefslogtreecommitdiff
path: root/cmake
AgeCommit message (Collapse)Author
2020-09-12Fixed pkg-config on other than Ubuntu GNU/Linux distributions. (#1043)Vitaly Zaitsev
Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
2020-08-27Fix Clang builds on Windows (#1021)Jeremy Ong
Fixes #974. The `cxx_feature_check` now has an additional optional argument which can be used to supply extra cmake flags to pass to the `try_compile` command. The `CMAKE_CXX_STANDARD=14` flag was determined to be the minimum flag necessary to correctly compile and run the regex feature checks when compiling with Clang under Windows (n.b. this does *not* refer to clang-cl, the frontend to the MSVC compiler). The additional flag is not enabled for any other compiler/platform tuple.
2020-08-21Ctest support (#1025)Dominic Hamon
* ctest is now working * Update README * remove commented out lines * Tweaked docs Added note to use parallel and cleaned build config notes * Response to comments * revert all but the readme * make error message clearer * drop --parallel
2019-10-04Cache RUN_${FEATURE} variable in CXXFeatureCheck.cmake (#886)Kyle Edwards
When cross-compiling, this variable was not set on the second run of CMake, resulting in the next check failing even though it shouldn't be run in the first place. Fix this by caching the variable.
2019-09-15Allow setting GOOGLETEST_PATH cmake argument. Fixes #867 (#868)Attila M. Szilagyi
In `cmake/GoogleTest.cmake`, GOOGLETEST_PATH is default-initialized, but that init forgot to account for the fact that the patch is explicitly supposed to be user-configurable. By passing `CACHE` to `set()` we avoid that error.
2019-04-30CMake: avoid incorrect extra "" around the GOOGLETEST_PATH.Roman Lebedev
It was looking in `"<...>/googlebenchmark/build/third_party/googletest"`, with these extra `"` quotes, and wasn't finding anything..
2019-04-30CMake: codedrop of googletest cmake magic from me (#809)Roman Lebedev
https://github.com/google/benchmark/pull/801 is stuck with some cryptic cmake failure due to some linking issue between googletest and threading libraries. I suspect that is mostly happening because of the, uhm, intentionally extremely twisted-in-the-brains approach that is being used to actually build the library as part of the buiild, except without actually building it as part of the build. If we do actually build it as part of the build, then all the transitive dependencies should magically be in order, and maybe everything will just work. This new version of cmake magic was written by me in https://github.com/darktable-org/rawspeed/blob/0e22f085c57cd629983c7351c598abd744b421b5/cmake/Modules/GoogleTest.cmake.in https://github.com/darktable-org/rawspeed/blob/0e22f085c57cd629983c7351c598abd744b421b5/cmake/Modules/GoogleTest.cmake, based on the official googletest docs and LOTS of experimentation.
2019-02-01Add -lpthread to pkg-config Libs.private. (#755)Daniel Kraft
Since pthread is required at least for GCC (according to the documentation), this should be reflected by the pkg-config file. The same is, for instance, also done by the gflags library: https://github.com/gflags/gflags/blob/1005485222e8b0feff822c5723ddcaa5abadc01a/cmake/package.pc.in#L13
2018-11-13Ensure all informational cmake messages have STATUS typeDominic Hamon
2018-10-13Fix SOURCE_DIR in HandleGTest.cmake (#705)Olzhas Kaiyrakhmet
If benchmark added as cmake subproject, HandleGTest throws an error as does return absolute source dir. Change it to , so it will be refering to it's own source dir. Also see PR #703.
2018-10-13Revert "Fix SOURCE_DIR in HandleGTest.cmake (#703)" (#704)Eric
This reverts commit 609752306fca311ee1caca2306696dfe245bdce4.
2018-10-13Fix SOURCE_DIR in HandleGTest.cmake (#703)Olzhas Kaiyrakhmet
* Fix SOURCE_DIR in HandleGTest.cmake If benchmark added as cmake subproject, HandleGTest throws an error as does return absolute source dir. Change it to , so it will be refering to it's own source dir.
2018-10-05Fix Clang Detection (#697)Gregorio Litenstein
For several versions now, CMake by default refers to macOS’ Clang as AppleClang instead of just Clang, which would fail STREQUAL. Fixed by changing it to MATCHES.
2018-05-14split_list is not defined for assembly tests (#595)Deniz Evrenci
* Update AUTHORS and CONTRIBUTORS * split_list is not defined for assembly tests
2018-05-08There is no "FATAL" in message(), only "FATAL_ERROR" (#584)Roman Lebedev
2018-05-08Run git from the source directory (#589) (#590)php1ic
Git was being executed in the current directory, so could not get the latest tag if cmake was run from a build directory. Force git to be run from with the source directory.
2018-04-23Add caching for cxx_feature_check (#573)Yangqing Jia
2018-04-05Fix #564 - gmock/gmock.h not found in benchmark tests.Eric Fiselier
2018-03-21Fix #538 - gtest.h not found when building with older CMake versions.Eric Fiselier
Older CMake versions, in particular 2.8, don't seem to correctly handle interface include directories. This causes failures when building the tests. Additionally, older CMake versions use a different library install directory than expected (i.e. they use lib/<target-triple>). This caused certain tests to fail to link. This patch fixes both those issues. The first by manually adding the correct include directory when building the tests. The second by specifying the library output directory when configuring the GTest build.
2018-02-14Improve State packing: put important members on first cache line. (#527)Eric
* Improve State packing: put important members on first cache line. This patch does a few different things to ensure commonly accessed data is on the first cache line of the `State` object. First, it moves the `error_occurred_` member to reside after the `started_` and `finished_` bools, since there was internal padding there that was unused. Second, it moves `batch_leftover_` and `max_iterations` further up in the struct declaration. These variables are used in the calculation of `iterations()` which users might call within the loop. Therefore it's more important they exist on the first cache line. Finally, this patch turns the bool members into bitfields. Although this shouldn't have much of an effect currently, because padding is still needed between the last bool and the first size_t, it should help in future changes that require more "bool like" members. * Remove bitfield change for now * Move bools (and their padding) to end of "first cache line" vars. I think it makes the most sense to move the padding required following the group of bools to the end of the variables we want on the first cache line. This also means that the `total_iterations_` variable, which is the most accessed, has the same address as the State object. * Fix static assertion after moving bools
2018-02-12Fix GTest workaround on MSVCEric Fiselier
2018-02-12Work around Gtest build failure caused by -Werror=unused-function. (#529)Eric
We're propagating extra warning flags to the gtest build, which can cause it to fail. This patch prevents passing "-Wextra" to gtest, since the library itself doesn't test with that flag.
2018-01-05Prevent GTest and GMock from being installed with Google Benchmark.Eric Fiselier
When users satisfy the GTest dependancy by placing a googletest directory in the project, the targets from GTest and GMock incorrectly get installed along side this library. We shouldn't be installing our test dependancies. This patch forces the options that control installation for googletest to OFF.
2017-12-13Add support for GTest based unit tests. (#485)Eric
* Add support for GTest based unit tests. As Dominic and I have previously discussed, there is some need/desire to improve the testing situation in Google Benchmark. One step to fixing this problem is to make it easier to write unit tests by adding support for GTest, which is what this patch does. By default it looks for an installed version of GTest. However the user can specify -DBENCHMARK_BUILD_EXTERNAL_GTEST=ON to instead download, build, and use copy of gtest from source. This is quite useful when Benchmark is being built in non-standard configurations, such as against libc++ or in 32 bit mode.
2017-11-29CMake: implement LTO for clang. Fixes #478 (#487)Roman Lebedev
* CMake: implement LTO for clang. Fixes #478 * LTO: add basic docs about required executables.
2017-11-15Add a pkg-config file, for the benefit of projects not using CMake. (#480)Steinar H. Gunderson
2017-08-28Attempting to resolve a submoduling issues... (#439)Roman Lebedev
2017-08-15CMake: Fallback from try_run to try_compile when cross-compiling. (#436)Victor Costan
2017-06-16Fix #403 HAVE_${VAR} not passed to makefile (#404)Jern-Kuan Leong
Add definition of ${VAR} to makefiles if specified as part of cmake parameter.
2017-04-04Merge branch '1.1' of git://github.com/piribes/benchmark into piribes-1.1Dominic Hamon
2017-04-03Add CMake Package Config files during installGiuseppe Roberti
- Remove target_include_directories of ${PROJECT_SOURCE_DIR}/include to fix error: Target "benchmark" INTERFACE_INCLUDE_DIRECTORIES property contains path which is prefixed in the source directory.
2017-03-28Add BENCHMARK_BUILD_32_BITS option and add builders to test it (#360)Eric
* Add BENCHMARK_BUILD_32_BITS option and add builders to test it * Attempt to fix travis configuration * Make add_required_cxx_compiler_flag cause an error when the flag isn't supported * add gcc-multilib dependancy on travis * attempt to fix travis.yml parsing error * Require g++-multilib instead of gcc-multilib * Add 32 bit release configurations * Attempt to fix libc++ travis build w/ 32 bits * Work around CMake configuration failure on Travis
2016-12-05Update the required CMake version to 2.8.12 (#316)Eric
2016-10-05Pass flag string to `check_cxx_compiler_flag` (#298)ktnyt
2016-08-29Add -DBENCHMARK_USE_LIBCXX:BOOL=<value> option. (#280)Eric
* Add BENCHMARK_USE_LIBCXX option. * Add comments * re-add zero null pointer warning
2016-05-23Prevent re-execution of slow feature tests.Eric Fiselier
2016-02-09Close a memory leak in configuration codeAlastair Murray
This was causing configuration failures on address sanitizer builds.
2015-10-18Fix get_git_version to use GIT_EXECUTABLE.Zbigniew Skowron
get_git_version CMake function uses 'git' command directly, instead of GIT_EXECUTABLE variable. This causes CMake errors while generating project files in environments, where 'git' command is not present in PATH.
2015-10-06CMake check for git on the systemTobias Ulvgard
2015-05-01Improve the CMake C++ flag checkerMatt Clarkson
This checks the flag on the compiler AND linker which allows it to work with flags such as -flto and -fsanitize=address
2015-03-26address review commentsEric Fiselier
2015-03-26finish selection of clock with debug informationEric Fiselier
2015-03-12Adopt new benchmark timing internals.Eric Fiselier
This patch adopts a new internal structure for how timings are performed. Currently every iteration of a benchmark checks to see if it has been running for an appropriate amount of time. Checking the clock introduces noise into the timings and this can cause inconsistent output from each benchmark. Now every iteration of a benchmark only checks an iteration count to see if it should stop running. The iteration count is determined before hand by testing the benchmark on a series of increasing iteration counts until a suitable count is found. This increases the amount of time it takes to run the actual benchmarks but it also greatly increases the accuracy of the results. This patch introduces some breaking changes. The notable breaking changes are: 1. Benchmarks run on multiple threads no generate a report per thread. Instead only a single report is generated. 2. ::benchmark::UseRealTime() was removed and replaced with State::UseRealTime().
2015-03-06Change std::regex detection test to detect bug in libstdc++.Eric Fiselier
libstdc++'s std::regex has (or had) a bug in std::regex::operator=(...) that caused undefined behaviour. Clang will detect this and compile the function so that it crashes at runtime. This patch tried to detect that bug during configuration.
2014-10-18Merge pull request #58 from google/zero_nullChris Kennelly
Fix #50 by using nullptr and adding stricter warning.
2014-10-11Fix #50 by using nullptr and adding stricter warning.Dominic Hamon
2014-10-11Fix #54 by correcting reference to CXX flags for variants.Dominic Hamon
2014-08-22Fixed the CMake add_cxx_compiler_flag functionMatt Clarkson
2014-08-22Resolve regular expression enginesMatt Clarkson
2014-08-15Do not use CMake CONCATMatt Clarkson
CONCAT was added quite late in the CMake release cycles so lets use `set()` instead which has been around _forever_...