File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 66
77macro (FindPython3)
88 # Use PYTHON_HOME as a hint to find Python 3.
9- set (Python3_ROOT_DIR "${PYTHON_HOME} " )
9+ if (NOT Python3_ROOT_DIR)
10+ set (Python3_ROOT_DIR "${PYTHON_HOME} " )
11+ endif ()
1012 find_package (Python3 COMPONENTS Interpreter Development)
1113 if (Python3_FOUND AND Python3_Interpreter_FOUND)
1214
Original file line number Diff line number Diff line change @@ -367,3 +367,10 @@ def delete_module_cache(path):
367367# Propagate XDG_CACHE_HOME
368368if "XDG_CACHE_HOME" in os .environ :
369369 config .environment ["XDG_CACHE_HOME" ] = os .environ ["XDG_CACHE_HOME" ]
370+
371+ # Some steps required to initialize the tests dynamically link with python.dll
372+ # and need to know the location of the Python libraries. This ensures that we
373+ # use the same version of Python that was used to build lldb to run our tests.
374+ config .environment ["PATH" ] = os .path .pathsep .join (
375+ (config .python_root_dir , config .environment .get ("PATH" , "" ))
376+ )
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
2020config.target_triple = "@LLVM_TARGET_TRIPLE@"
2121config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
2222config.python_executable = "@Python3_EXECUTABLE@"
23+ config.python_root_dir = "@Python3_ROOT_DIR@"
2324config.lua_executable = "@LUA_EXECUTABLE@"
2425config.lldb_lua_cpath = "@LLDB_LUA_CPATH@"
2526config.lua_test_entry = "TestLuaAPI.py"
Original file line number Diff line number Diff line change @@ -224,3 +224,6 @@ def calculate_arch_features(arch_string):
224224# location of the Python libraries. This ensures that we use the same
225225# version of Python that was used to build lldb to run our tests.
226226config .environment ["PYTHONHOME" ] = config .python_root_dir
227+ config .environment ["PATH" ] = os .path .pathsep .join (
228+ (config .python_root_dir , config .environment .get ("PATH" , "" ))
229+ )
You can’t perform that action at this time.
0 commit comments