Skip to content

Commit

Permalink
CMake: add DART_USE_SYSTEM_GOOGLEBENCHMARK (#1904)
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s authored Jan 20, 2025
1 parent c930216 commit c18c48a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ dart_option(DART_FAST_DEBUG "Add -O1 option for DEBUG mode build" OFF)
dart_option(DART_FORCE_COLORED_OUTPUT
"Always produce ANSI-colored output (GNU/Clang only)." OFF)
dart_option(DART_USE_SYSTEM_IMGUI "Use system ImGui" OFF)
dart_option(DART_USE_SYSTEM_GOOGLEBENCHMARK "Use system GoogleBenchmark" OFF)
dart_option(DART_USE_SYSTEM_GOOGLETEST "Use system GoogleTest" OFF)

#===============================================================================
Expand Down Expand Up @@ -259,7 +260,7 @@ if(MSVC)

elseif(CMAKE_COMPILER_IS_GNUCXX)

# There is a known bug in GCC 12.1 and above that leads to spurious
# There is a known bug in GCC 12.1 and above that leads to spurious
# -Wmaybe-uninitialized warnings from gcc/x86_64-linux-gnu/12/include/avxintrin.h and
# -Warray-bounds warnings from gcc/x86_64-linux-gnu/12/include/avx512fintrin.h.
# The bug is tracked here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593
Expand Down
20 changes: 12 additions & 8 deletions tests/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

include(FetchContent)
FetchContent_Declare(
benchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.8.3
)
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(benchmark)
if(DART_USE_SYSTEM_GOOGLEBENCHMARK)
find_package(benchmark REQUIRED)
else()
include(FetchContent)
FetchContent_Declare(
benchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.8.3
)
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(benchmark)
endif()

add_subdirectory(unit)
add_subdirectory(integration)

0 comments on commit c18c48a

Please sign in to comment.