From 4f2e3f33994193441bffa5ab4502a5af5a077a6a Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller Date: Thu, 22 Oct 2026 17:14:53 +0200 Subject: [PATCH] [cppjit] Keep LD_LIBRARY_PATH from the environment in the tests --- bindings/pyroot/cppjit/test/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/pyroot/cppjit/test/CMakeLists.txt b/bindings/pyroot/cppjit/test/CMakeLists.txt index 482c2abb89102..5932f461d68f7 100644 --- a/bindings/pyroot/cppjit/test/CMakeLists.txt +++ b/bindings/pyroot/cppjit/test/CMakeLists.txt @@ -14,7 +14,11 @@ cmake_path(CONVERT "${pythonpaths}" TO_NATIVE_PATH_LIST pythonpaths_native) set(common_env PYTHONPATH=${pythonpaths_native} CPPJIT_TEST_SKIP_MAKE=1) if(NOT MSVC) - list(APPEND common_env ${ld_library_path}=${CMAKE_CURRENT_BINARY_DIR}) + # Keep the library path of the environment, which may be needed to find, + # for example, the C++ standard library of the compiler that built ROOT. + set(ld_library_paths ${CMAKE_CURRENT_BINARY_DIR} $ENV{${ld_library_path}}) + cmake_path(CONVERT "${ld_library_paths}" TO_NATIVE_PATH_LIST ld_library_paths_native) + list(APPEND common_env ${ld_library_path}=${ld_library_paths_native}) endif() # Some dictionary sources include Python.h (e.g. pythonizables.cxx), which