fix: install catch2 only with BUILD_TESTS enabled

Signed-off-by: szdytom <szdytom@qq.com>
This commit is contained in:
方而静 2025-08-06 12:27:38 +08:00
parent 4604a343cd
commit c6d311128e
Signed by: szTom
GPG Key ID: 072D999D60C6473C

View File

@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.27)
cmake_policy(VERSION 3.27)
include(FetchContent)
IF(BUILD_TESTS)
# Catch2 third-party library setup
message(STATUS "Downloading Catch2...")
FetchContent_Declare(
@ -10,3 +12,5 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(Catch2)
message(STATUS "Catch2 ready")
endif()