mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-02 21:09:40 +00:00
Merge branch 'system_benchmark' into 'master'
Support system Google Benchmark See merge request OpenMW/openmw!1000
This commit is contained in:
commit
c774a68439
1 changed files with 21 additions and 15 deletions
|
@ -1,22 +1,28 @@
|
|||
cmake_minimum_required(VERSION 3.11)
|
||||
option(OPENMW_USE_SYSTEM_BENCHMARK "Use system Google Benchmark library." OFF)
|
||||
|
||||
set(BENCHMARK_ENABLE_TESTING OFF)
|
||||
set(BENCHMARK_ENABLE_INSTALL OFF)
|
||||
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
|
||||
if(OPENMW_USE_SYSTEM_BENCHMARK)
|
||||
find_package(benchmark REQUIRED)
|
||||
else()
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
set(SAVED_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
set(BENCHMARK_ENABLE_TESTING OFF)
|
||||
set(BENCHMARK_ENABLE_INSTALL OFF)
|
||||
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
|
||||
|
||||
string(REPLACE "-Wsuggest-override" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE "-Wundef" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(benchmark
|
||||
URL https://github.com/google/benchmark/archive/refs/tags/v1.5.2.zip
|
||||
URL_HASH MD5=49395b757a7c4656d70f1328d93efd00
|
||||
SOURCE_DIR fetched/benchmark
|
||||
)
|
||||
FetchContent_MakeAvailableExcludeFromAll(benchmark)
|
||||
set(SAVED_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${SAVED_CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE "-Wsuggest-override" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE "-Wundef" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(benchmark
|
||||
URL https://github.com/google/benchmark/archive/refs/tags/v1.5.2.zip
|
||||
URL_HASH MD5=49395b757a7c4656d70f1328d93efd00
|
||||
SOURCE_DIR fetched/benchmark
|
||||
)
|
||||
FetchContent_MakeAvailableExcludeFromAll(benchmark)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${SAVED_CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
openmw_add_executable(openmw_detournavigator_navmeshtilescache_benchmark detournavigator/navmeshtilescache.cpp)
|
||||
target_compile_features(openmw_detournavigator_navmeshtilescache_benchmark PRIVATE cxx_std_17)
|
||||
|
|
Loading…
Reference in a new issue