From e7d1560f0e252e45cc6316707545c44752ad490f Mon Sep 17 00:00:00 2001 From: Alex Tyler Chapman Date: Wed, 11 Dec 2024 15:29:20 -0800 Subject: [PATCH] Provide a way to disable Serac benchmarks --- cmake/SeracBasics.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/SeracBasics.cmake b/cmake/SeracBasics.cmake index 50fb02dd2..c539f8026 100644 --- a/cmake/SeracBasics.cmake +++ b/cmake/SeracBasics.cmake @@ -43,9 +43,10 @@ endif() option(SERAC_ENABLE_PROFILING "Enable profiling functionality" OFF) -if (ENABLE_BENCHMARKS) - set(SERAC_ENABLE_BENCHMARKS ON) -endif() +# ENABLE_BENCHMARKS must be ON in order to modify SERAC_ENABLE_BENCHMARKS. +# SERAC_ENABLE_BENCHMARKS will automatically be set to ON if ENABLE_BENCHMARKS is ON. +# SERAC_ENABLE_BENCHMARKS is an option to allow external projects to disable Serac benchmarks while enabling theirs. +cmake_dependent_option(SERAC_ENABLE_BENCHMARKS "Enable benchmark executables" ON "ENABLE_BENCHMARKS" OFF) # User turned on benchmarking but explicitly turned off profiling. Error out. if ((ENABLE_BENCHMARKS OR SERAC_ENABLE_BENCHMARKS) AND NOT SERAC_ENABLE_PROFILING)