From c861593c6cbc5e025723d6b46913c41203477ca6 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Wed, 27 Oct 2021 18:02:28 +0300 Subject: [PATCH] CMake: fix `SENTRY_BACKEND` defined in outer scope --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e740ed0b..5d3e9e3d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,8 +130,10 @@ else() set(SENTRY_DEFAULT_BACKEND "inproc") endif() -set(SENTRY_BACKEND ${SENTRY_DEFAULT_BACKEND} CACHE STRING - "The sentry backend responsible for reporting crashes, can be either 'none', 'inproc', 'breakpad' or 'crashpad'.") +if(NOT DEFINED SENTRY_BACKEND) + set(SENTRY_BACKEND ${SENTRY_DEFAULT_BACKEND} CACHE STRING + "The sentry backend responsible for reporting crashes, can be either 'none', 'inproc', 'breakpad' or 'crashpad'.") +endif() if(SENTRY_BACKEND STREQUAL "crashpad") set(SENTRY_BACKEND_CRASHPAD TRUE)