mirror of
https://github.com/google/googletest.git
synced 2026-04-30 19:09:20 +08:00
Fix CMake 3.22 crash in find_package(Python3) when Python is absent
This commit is contained in:
parent
73a63ea05d
commit
f426a71abf
@ -255,7 +255,12 @@ function(cxx_executable name dir libs)
|
||||
endfunction()
|
||||
|
||||
if(gtest_build_tests)
|
||||
find_package(Python3)
|
||||
# Only the interpreter is needed for Python tests. Specifying the component
|
||||
# explicitly avoids a crash in CMake <= 3.23's FindPython3 module when no
|
||||
# Python installation is present (the module calls list(GET) on an empty
|
||||
# list). QUIET lets the build continue without Python tests instead of
|
||||
# failing outright.
|
||||
find_package(Python3 COMPONENTS Interpreter QUIET)
|
||||
endif()
|
||||
|
||||
# cxx_test_with_flags(name cxx_flags libs srcs...)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user