mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Make test_util GTest-optional to fix benchmark builds with BUILD_TESTING=OFF
When Ceres is configured with BUILD_TESTING=OFF and BUILD_BENCHMARKS=ON, benchmarks failed to compile and link due to an unconditional dependency on the test_util library, which requires Googletest (GTest). This commit addresses the issue by introducing the CERES_HAS_GTEST macro and making the test utility library GTest-optional. Fixes: https://github.com/ceres-solver/ceres-solver/issues/1081 Change-Id: I615c37eb6f21d36a4b87b2d24632016944eda3bd
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
// Author: sameeragarwal@google.com (Sameer Agarwal)
|
||||
// tbennun@gmail.com (Tal Ben-Nun)
|
||||
|
||||
#ifdef CERES_HAS_GTEST
|
||||
|
||||
#include "ceres/numeric_diff_test_utils.h"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -255,3 +257,5 @@ void RandomizedFunctor::ExpectCostFunctionEvaluationIsNearlyCorrect(
|
||||
}
|
||||
|
||||
} // namespace ceres::internal
|
||||
|
||||
#endif // CERES_HAS_GTEST
|
||||
|
||||
Reference in New Issue
Block a user