diff --git a/core/relinker/CMakeLists.txt b/core/relinker/CMakeLists.txt index f82728eb4..a48325819 100644 --- a/core/relinker/CMakeLists.txt +++ b/core/relinker/CMakeLists.txt @@ -73,11 +73,15 @@ endif() if(BUILD_TESTING) - find_package(Python3 REQUIRED COMPONENTS Interpreter) - add_test(NAME optional_plt COMMAND ${Python3_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/relinker/tests/test_optional_plt.py $) - add_test(NAME empty_tls COMMAND ${Python3_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/relinker/tests/test_empty_tls.py $) + find_package(Python3 QUIET COMPONENTS Interpreter) + if(Python3_Interpreter_FOUND) + add_test(NAME optional_plt COMMAND ${Python3_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR}/relinker/tests/test_optional_plt.py $) + add_test(NAME empty_tls COMMAND ${Python3_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR}/relinker/tests/test_empty_tls.py $) + else() + message(STATUS "Python3 interpreter not found; skipping optional_plt and empty_tls tests") + endif() add_executable(strict_nid_filter_tests ${CMAKE_CURRENT_SOURCE_DIR}/relinker/tests/StrictNidFilterTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/relinker/src/analysis/UnusedNidFilter/StrictNidFilter.cpp