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 6
6
7
7
macro (FindPython3 )
8
8
# 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 ()
10
12
find_package (Python3 COMPONENTS Interpreter Development )
11
13
if (Python3_FOUND AND Python3_Interpreter_FOUND )
12
14
Original file line number Diff line number Diff line change @@ -367,3 +367,10 @@ def delete_module_cache(path):
367
367
# Propagate XDG_CACHE_HOME
368
368
if "XDG_CACHE_HOME" in os .environ :
369
369
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@"
20
20
config.target_triple = "@LLVM_TARGET_TRIPLE@"
21
21
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
22
22
config.python_executable = "@Python3_EXECUTABLE@"
23
+ config.python_root_dir = "@Python3_ROOT_DIR@"
23
24
config.lua_executable = "@LUA_EXECUTABLE@"
24
25
config.lldb_lua_cpath = "@LLDB_LUA_CPATH@"
25
26
config.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):
224
224
# location of the Python libraries. This ensures that we use the same
225
225
# version of Python that was used to build lldb to run our tests.
226
226
config .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