Commit dc106455 by Reid Kleckner Committed by Roman Lebedev

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.
parent 4528c76b
cmake_minimum_required (VERSION 2.8.12) cmake_minimum_required (VERSION 2.8.12)
project (benchmark)
foreach(p foreach(p
CMP0048 # OK to clear PROJECT_VERSION on project()
CMP0054 # CMake 3.1 CMP0054 # CMake 3.1
CMP0056 # export EXE_LINKER_FLAGS to try_run CMP0056 # export EXE_LINKER_FLAGS to try_run
CMP0057 # Support no if() IN_LIST operator CMP0057 # Support no if() IN_LIST operator
...@@ -12,6 +11,8 @@ foreach(p ...@@ -12,6 +11,8 @@ foreach(p
endif() endif()
endforeach() endforeach()
project (benchmark)
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON) 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_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON)
option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF) option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment