From 519d26e13cbeb3542cf69684b243e006c0ddc84f Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 19 Feb 2023 20:26:24 +0100 Subject: [PATCH] CMake: fix linking error in test function when linking Python statically --- tests/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bc50262481..2dbb3ee381 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,6 +25,13 @@ if(MSVC) endif() endif() +if(NOT BUILD_DYNAMIC_LINK_PYTHON) + list(APPEND Google_Tests_LIBS + ${PYTHON_LIBRARIES} + ) +endif() + + add_executable(Tests_run) add_subdirectory(lib) add_subdirectory(src)