diff options
author | Reid Kleckner <rnk@google.com> | 2018-12-30 09:46:07 -0800 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2018-12-30 20:46:07 +0300 |
commit | dc1064554905deca47386bdfc4b72f44c1bd7716 (patch) | |
tree | 955ed43cb55a54c0db995457ca6360764c55e628 | |
parent | 4528c76b718acc9b57956f63069c699ae21edcab (diff) | |
download | google-benchmark-dc1064554905deca47386bdfc4b72f44c1bd7716.tar.gz |
Set CMP0048 policy before project() to silence warnings (#750)
If this policy isn't set, CMake emits a large warning when project() is
called from a cmake subdirectory.
This came up when the benchmark library was added to the LLVM build, and
it was reported in https://llvm.org/PR38874. This patch was the fix I
applied locally to fix the issue, and I wanted to send it upstream.
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 310c7ee..76e5fc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required (VERSION 2.8.12) -project (benchmark) - foreach(p + CMP0048 # OK to clear PROJECT_VERSION on project() CMP0054 # CMake 3.1 CMP0056 # export EXE_LINKER_FLAGS to try_run CMP0057 # Support no if() IN_LIST operator @@ -12,6 +11,8 @@ foreach(p endif() endforeach() +project (benchmark) + option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON) option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON) option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF) |