Guard tst_grpc_client_test_common build

The libraty cannot be built if grpc_testserver is missing.

Pick-to: 6.10 6.9 6.8
Change-Id: I34f6a419e2726ec23ac78f0b95f0974df2080547
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
This commit is contained in:
Alexey Edelev 2025-09-02 14:52:13 +02:00
parent b00344793d
commit 6de39ba5eb
1 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,10 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
if(NOT TARGET grpc_testserver)
return()
endif()
set(CMAKE_AUTOMOC TRUE)
qt6_add_library(tst_grpc_client_test_common STATIC
@ -8,11 +12,9 @@ qt6_add_library(tst_grpc_client_test_common STATIC
${CMAKE_CURRENT_LIST_DIR}/grpcclienttestbase.cpp
)
if(TARGET grpc_testserver)
target_compile_definitions(tst_grpc_client_test_common PRIVATE
TEST_GRPC_SERVER_PATH="$<TARGET_FILE:grpc_testserver>"
)
endif()
target_compile_definitions(tst_grpc_client_test_common PRIVATE
TEST_GRPC_SERVER_PATH="$<TARGET_FILE:grpc_testserver>"
)
if(qt_internal_grpc_use_golang_test_server)
target_compile_definitions(tst_grpc_client_test_common PRIVATE