[PATCH] D61660: [cmake] Make google benchmark project call llvm_add_library

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 10:00:22 PDT 2019


beanz added inline comments.


================
Comment at: llvm/utils/benchmark/CMakeLists.txt:12
+
+  project (benchmark)
 endif()
----------------
The `project` call isn't what resets the policy state. You actually need to pull `cmake_minimum_required` into the `if` block to prevent resetting the policy state:
https://cmake.org/cmake/help/v3.0/command/cmake_minimum_required.html


================
Comment at: llvm/utils/benchmark/CMakeLists.txt:16
+if(CMAKE_PROJECT_NAME STREQUAL "LLVM")
+  function(benchmark_add_library target)
+    llvm_add_library(${target} ${ARGN})
----------------
@lebedev.ri's suggestion to make this change more upstream-able to google benchmark is to define `benchmark_add_library` in LLVM (maybe in AddLLVM.cmake), then change to checking if `benchmark_add_library` is defined and define it if it isn't.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61660/new/

https://reviews.llvm.org/D61660





More information about the llvm-commits mailing list