From c37f535995e052bb7c36cabc3581dd609af128ad Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 27 Jul 2020 12:30:09 -0700 Subject: [PATCH 1/3] [lldb] Remove CMAKE_VERSION checks now that the minimum version is 3.13.4 (cherry picked from commit 536baa11cfe12362ea646ad731a2274a07208cc0) --- .../modules/FindPythonInterpAndLibs.cmake | 38 ++++--------------- lldb/cmake/modules/LLDBConfig.cmake | 5 --- 2 files changed, 7 insertions(+), 36 deletions(-) diff --git a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake index 243e0463f48b6..3a64ebbcf9721 100644 --- a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake +++ b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake @@ -61,46 +61,22 @@ if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS AND PYTHON_EXECUTABLE AND SWIG_EXECU else() find_package(SWIG 2.0) if (SWIG_FOUND) - if(NOT CMAKE_VERSION VERSION_LESS 3.12) - if (LLDB_PYTHON_VERSION) - if (LLDB_PYTHON_VERSION VERSION_EQUAL "2") - FindPython2() - elseif(LLDB_PYTHON_VERSION VERSION_EQUAL "3") - FindPython3() - endif() - else() + if (LLDB_PYTHON_VERSION) + if (LLDB_PYTHON_VERSION VERSION_EQUAL "2") + FindPython2() + elseif(LLDB_PYTHON_VERSION VERSION_EQUAL "3") FindPython3() - if (NOT PYTHON3_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows) - FindPython2() - endif() endif() else() - find_package(PythonInterp) - find_package(PythonLibs) - if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND SWIG_FOUND) - if (NOT CMAKE_CROSSCOMPILING) - string(REPLACE "." ";" pythonlibs_version_list ${PYTHONLIBS_VERSION_STRING}) - list(GET pythonlibs_version_list 0 pythonlibs_major) - list(GET pythonlibs_version_list 1 pythonlibs_minor) - - # Ignore the patch version. Some versions of macOS report a different - # patch version for the system provided interpreter and libraries. - if (CMAKE_CROSSCOMPILING OR (PYTHON_VERSION_MAJOR VERSION_EQUAL pythonlibs_major AND - PYTHON_VERSION_MINOR VERSION_EQUAL pythonlibs_minor)) - mark_as_advanced( - PYTHON_LIBRARIES - PYTHON_INCLUDE_DIRS - PYTHON_EXECUTABLE - SWIG_EXECUTABLE) - endif() - endif() + FindPython3() + if (NOT PYTHON3_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows) + FindPython2() endif() endif() else() message(STATUS "SWIG 2 or later is required for Python support in LLDB but could not be found") endif() - include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PythonInterpAndLibs FOUND_VAR diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index 8465cfe3b7b72..7e5848c800f87 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -79,11 +79,6 @@ if(LLDB_BUILD_FRAMEWORK) if(NOT APPLE) message(FATAL_ERROR "LLDB.framework can only be generated when targeting Apple platforms") endif() - # CMake 3.6 did not correctly emit POST_BUILD commands for Apple Framework targets - # CMake < 3.8 did not have the BUILD_RPATH target property - if(CMAKE_VERSION VERSION_LESS 3.8) - message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.8") - endif() set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)") set(LLDB_FRAMEWORK_BUILD_DIR bin CACHE STRING "Output directory for LLDB.framework") From 1249f40424e9ea995ea331029d7f34efd553d96f Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 14 Aug 2020 08:44:29 -0700 Subject: [PATCH 2/3] [lldb] Remove Python 2 fallback and only support Python 3 This removes the fallback to Python 2 and makes Python 3 the only supported configuration. This is the first step to fully migrate to Python 3 over the coming releases as discussed on the mailing list. http://lists.llvm.org/pipermail/lldb-dev/2020-August/016388.html As a reminder, for the current release the test suite and the generated bindings should remain compatible with Python 2. Differential revision: https://reviews.llvm.org/D85942 (cherry picked from commit ce439cb1c962360267fb7a94d44ad57053787607) --- .../modules/FindPythonInterpAndLibs.cmake | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake index 3a64ebbcf9721..5ac472b036d7f 100644 --- a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake +++ b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake @@ -38,41 +38,12 @@ macro(FindPython3) endif() endmacro() -macro(FindPython2) - # Use PYTHON_HOME as a hint to find Python 2. - set(Python2_ROOT_DIR "${PYTHON_HOME}") - find_package(Python2 COMPONENTS Interpreter Development) - if(Python2_FOUND AND Python2_Interpreter_FOUND) - set(PYTHON_LIBRARIES ${Python2_LIBRARIES}) - set(PYTHON_INCLUDE_DIRS ${Python2_INCLUDE_DIRS}) - set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) - - set(PYTHON2_FOUND TRUE) - mark_as_advanced( - PYTHON_LIBRARIES - PYTHON_INCLUDE_DIRS - PYTHON_EXECUTABLE - SWIG_EXECUTABLE) - endif() -endmacro() - if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS AND PYTHON_EXECUTABLE AND SWIG_EXECUTABLE) set(PYTHONINTERPANDLIBS_FOUND TRUE) else() find_package(SWIG 2.0) if (SWIG_FOUND) - if (LLDB_PYTHON_VERSION) - if (LLDB_PYTHON_VERSION VERSION_EQUAL "2") - FindPython2() - elseif(LLDB_PYTHON_VERSION VERSION_EQUAL "3") - FindPython3() - endif() - else() FindPython3() - if (NOT PYTHON3_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows) - FindPython2() - endif() - endif() else() message(STATUS "SWIG 2 or later is required for Python support in LLDB but could not be found") endif() From 192b34147cdd76f90d5f619ef2885f126637a134 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 17 Aug 2020 08:47:52 -0700 Subject: [PATCH 3/3] [lldb] Get rid of helper CMake variables for Python This patch is a big sed to rename the following variables: s/PYTHON_LIBRARIES/Python3_LIBRARIES/g s/PYTHON_INCLUDE_DIRS/Python3_INCLUDE_DIRS/g s/PYTHON_EXECUTABLE/Python3_EXECUTABLE/g s/PYTHON_RPATH/Python3_RPATH/g I've also renamed the CMake module to better express its purpose and for consistency with FindLuaAndSwig. Differential revision: https://reviews.llvm.org/D85976 (cherry picked from commit 75966ee241a2f1b7712caa1bbe66560347b23359) --- lldb/CMakeLists.txt | 2 +- lldb/bindings/python/CMakeLists.txt | 2 +- ...pAndLibs.cmake => FindPythonAndSwig.cmake} | 29 +++++++++---------- lldb/cmake/modules/LLDBConfig.cmake | 6 ++-- lldb/source/API/CMakeLists.txt | 10 +++---- lldb/source/Plugins/ObjectFile/CMakeLists.txt | 2 +- .../ScriptInterpreter/None/CMakeLists.txt | 2 +- .../ScriptInterpreter/Python/CMakeLists.txt | 2 +- lldb/test/API/CMakeLists.txt | 2 +- lldb/test/API/lit.site.cfg.py.in | 2 +- lldb/test/CMakeLists.txt | 2 +- lldb/test/Shell/lit.site.cfg.py.in | 2 +- lldb/test/Unit/lit.site.cfg.py.in | 2 +- lldb/test/lit.site.cfg.py.in | 2 +- lldb/tools/intel-features/CMakeLists.txt | 2 +- lldb/tools/lldb-test/CMakeLists.txt | 6 ++-- lldb/unittests/API/CMakeLists.txt | 4 +-- lldb/unittests/Process/Linux/CMakeLists.txt | 2 +- .../ScriptInterpreter/Lua/CMakeLists.txt | 2 +- .../ScriptInterpreter/Python/CMakeLists.txt | 6 ++-- lldb/utils/lldb-dotest/lldb-dotest.in | 2 +- 21 files changed, 44 insertions(+), 47 deletions(-) rename lldb/cmake/modules/{FindPythonInterpAndLibs.cmake => FindPythonAndSwig.cmake} (67%) diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index a8d7cf7d083f5..8e3f4b7948461 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -45,7 +45,7 @@ endif() if (LLDB_ENABLE_PYTHON) execute_process( - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))" OUTPUT_VARIABLE LLDB_PYTHON_DEFAULT_RELATIVE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/lldb/bindings/python/CMakeLists.txt b/lldb/bindings/python/CMakeLists.txt index 129fee99e4b92..baad7e8f0eba7 100644 --- a/lldb/bindings/python/CMakeLists.txt +++ b/lldb/bindings/python/CMakeLists.txt @@ -28,7 +28,7 @@ function(create_python_package swig_target working_dir pkg_dir) set(copy_cmd COMMAND ${CMAKE_COMMAND} -E copy ${ARG_FILES} ${pkg_dir}) endif() if(NOT ARG_NOINIT) - set(init_cmd COMMAND ${PYTHON_EXECUTABLE} + set(init_cmd COMMAND ${Python3_EXECUTABLE} "${LLDB_SOURCE_DIR}/bindings/python/createPythonInit.py" "${pkg_dir}" ${ARG_FILES}) endif() diff --git a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake b/lldb/cmake/modules/FindPythonAndSwig.cmake similarity index 67% rename from lldb/cmake/modules/FindPythonInterpAndLibs.cmake rename to lldb/cmake/modules/FindPythonAndSwig.cmake index 5ac472b036d7f..c8edaaaca3e06 100644 --- a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake +++ b/lldb/cmake/modules/FindPythonAndSwig.cmake @@ -1,5 +1,5 @@ #.rst: -# FindPythonInterpAndLibs +# FindPythonAndSwig # ----------- # # Find the python interpreter and libraries as a whole. @@ -9,9 +9,6 @@ macro(FindPython3) set(Python3_ROOT_DIR "${PYTHON_HOME}") find_package(Python3 COMPONENTS Interpreter Development) if(Python3_FOUND AND Python3_Interpreter_FOUND) - set(PYTHON_LIBRARIES ${Python3_LIBRARIES}) - set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS}) - set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) # The install name for the Python 3 framework in Xcode is relative to # the framework's location and not the dylib itself. @@ -25,21 +22,21 @@ macro(FindPython3) # called Python.framework instead of Python3.framework. if (APPLE AND Python3_LIBRARIES MATCHES "Python3.framework") string(FIND "${Python3_LIBRARIES}" "Python3.framework" python_framework_pos) - string(SUBSTRING "${Python3_LIBRARIES}" "0" ${python_framework_pos} PYTHON_RPATH) + string(SUBSTRING "${Python3_LIBRARIES}" "0" ${python_framework_pos} Python3_RPATH) endif() set(PYTHON3_FOUND TRUE) mark_as_advanced( - PYTHON_LIBRARIES - PYTHON_INCLUDE_DIRS - PYTHON_EXECUTABLE - PYTHON_RPATH + Python3_LIBRARIES + Python3_INCLUDE_DIRS + Python3_EXECUTABLE + Python3_RPATH SWIG_EXECUTABLE) endif() endmacro() -if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS AND PYTHON_EXECUTABLE AND SWIG_EXECUTABLE) - set(PYTHONINTERPANDLIBS_FOUND TRUE) +if(Python3_LIBRARIES AND Python3_INCLUDE_DIRS AND Python3_EXECUTABLE AND SWIG_EXECUTABLE) + set(PYTHONANDSWIG_FOUND TRUE) else() find_package(SWIG 2.0) if (SWIG_FOUND) @@ -49,12 +46,12 @@ else() endif() include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(PythonInterpAndLibs + find_package_handle_standard_args(PythonAndSwig FOUND_VAR - PYTHONINTERPANDLIBS_FOUND + PYTHONANDSWIG_FOUND REQUIRED_VARS - PYTHON_LIBRARIES - PYTHON_INCLUDE_DIRS - PYTHON_EXECUTABLE + Python3_LIBRARIES + Python3_INCLUDE_DIRS + Python3_EXECUTABLE SWIG_EXECUTABLE) endif() diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index 7e5848c800f87..0218ec0c0f1e5 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -56,7 +56,7 @@ add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" Li add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND) add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND) add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND) -add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonInterpAndLibs PYTHONINTERPANDLIBS_FOUND) +add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND) add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8) option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a copy of it" OFF) @@ -143,9 +143,9 @@ if (LLDB_ENABLE_PYTHON) "Embed PYTHONHOME in the binary. If set to OFF, PYTHONHOME environment variable will be used to to locate Python." ${default_embed_python_home}) - include_directories(${PYTHON_INCLUDE_DIRS}) + include_directories(${Python3_INCLUDE_DIRS}) if (LLDB_EMBED_PYTHON_HOME) - get_filename_component(PYTHON_HOME "${PYTHON_EXECUTABLE}" DIRECTORY) + get_filename_component(PYTHON_HOME "${Python3_EXECUTABLE}" DIRECTORY) set(LLDB_PYTHON_HOME "${PYTHON_HOME}" CACHE STRING "Path to use as PYTHONHOME in lldb. If a relative path is specified, it will be resolved at runtime relative to liblldb directory.") endif() diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index 48631c96ae18a..329e04359b1a6 100644 --- a/lldb/source/API/CMakeLists.txt +++ b/lldb/source/API/CMakeLists.txt @@ -121,9 +121,9 @@ if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX A set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}") endif() -if(PYTHON_RPATH) - set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${PYTHON_RPATH}") - set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}") +if(Python3_RPATH) + set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}") + set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}") endif() if (MSVC) @@ -187,9 +187,9 @@ endif() if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs, - # so only it needs to explicitly link against ${PYTHON_LIBRARIES} + # so only it needs to explicitly link against ${Python3_LIBRARIES} if (MSVC AND LLDB_ENABLE_PYTHON) - target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARIES}) + target_link_libraries(liblldb PRIVATE ${Python3_LIBRARIES}) endif() else() set_target_properties(liblldb diff --git a/lldb/source/Plugins/ObjectFile/CMakeLists.txt b/lldb/source/Plugins/ObjectFile/CMakeLists.txt index 76f6d7ad0d78a..77ca511bd7cf1 100644 --- a/lldb/source/Plugins/ObjectFile/CMakeLists.txt +++ b/lldb/source/Plugins/ObjectFile/CMakeLists.txt @@ -3,4 +3,4 @@ add_subdirectory(ELF) add_subdirectory(Mach-O) add_subdirectory(PECOFF) add_subdirectory(JIT) -add_subdirectory(wasm) \ No newline at end of file +add_subdirectory(wasm) diff --git a/lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt index 7e7dd5896f7c8..ce4fb4f9c0a03 100644 --- a/lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt +++ b/lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt @@ -4,4 +4,4 @@ add_lldb_library(lldbPluginScriptInterpreterNone PLUGIN LINK_LIBS lldbCore lldbInterpreter - ) \ No newline at end of file + ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt index 761772f3a3718..2cbf8bcbb229d 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt +++ b/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt @@ -19,7 +19,7 @@ add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN lldbHost lldbInterpreter lldbTarget - ${PYTHON_LIBRARIES} + ${Python3_LIBRARIES} ${LLDB_LIBEDIT_LIBS} LINK_COMPONENTS diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt index a80992f287e9e..192c0adc66a23 100644 --- a/lldb/test/API/CMakeLists.txt +++ b/lldb/test/API/CMakeLists.txt @@ -1,6 +1,6 @@ function(add_python_test_target name test_script args comment) set(PYTHON_TEST_COMMAND - ${PYTHON_EXECUTABLE} + ${Python3_EXECUTABLE} ${test_script} ${args} ) diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in index 866dc1675e7cf..3a108ae5c85a2 100644 --- a/lldb/test/API/lit.site.cfg.py.in +++ b/lldb/test/API/lit.site.cfg.py.in @@ -19,7 +19,7 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" config.target_triple = "@TARGET_TRIPLE@" config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@" config.lldb_reproducer_directory = os.path.join("@LLDB_TEST_BUILD_DIRECTORY@", "reproducers") -config.python_executable = "@PYTHON_EXECUTABLE@" +config.python_executable = "@Python3_EXECUTABLE@" config.dotest_path = "@LLDB_SOURCE_DIR@/test/API/dotest.py" config.dotest_args_str = "@LLDB_DOTEST_ARGS@" config.lldb_enable_python = @LLDB_ENABLE_PYTHON@ diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index dc5af5e2defe7..c0249180253ab 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -218,7 +218,7 @@ if(LLDB_BUILT_STANDALONE) if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit) # LLVM's make_paths_relative uses Python3_EXECUTABLE which isn't set in a # standalone LLDB build. - set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE}) + set(Python3_EXECUTABLE ${Python3_EXECUTABLE}) add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit) endif() endif() diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in index d998a0ca51c95..ff4de9d527dea 100644 --- a/lldb/test/Shell/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -13,7 +13,7 @@ config.lldb_tools_dir = "@LLDB_TOOLS_DIR@" # should not need to be escaped. config.lldb_lit_tools_dir = r"@LLDB_LIT_TOOLS_DIR@" config.target_triple = "@TARGET_TRIPLE@" -config.python_executable = "@PYTHON_EXECUTABLE@" +config.python_executable = "@Python3_EXECUTABLE@" config.have_zlib = @LLVM_ENABLE_ZLIB@ config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@ config.host_triple = "@LLVM_HOST_TRIPLE@" diff --git a/lldb/test/Unit/lit.site.cfg.py.in b/lldb/test/Unit/lit.site.cfg.py.in index 9d9bcd4ba628d..e2035d678cd98 100644 --- a/lldb/test/Unit/lit.site.cfg.py.in +++ b/lldb/test/Unit/lit.site.cfg.py.in @@ -10,7 +10,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.target_triple = "@TARGET_TRIPLE@" -config.python_executable = "@PYTHON_EXECUTABLE@" +config.python_executable = "@Python3_EXECUTABLE@" # Support substitution of the tools and libs dirs with user parameters. This is # used when we can't determine the tool dir at configuration time. diff --git a/lldb/test/lit.site.cfg.py.in b/lldb/test/lit.site.cfg.py.in index 49d789d42d9a1..24c0a4d5aa04c 100644 --- a/lldb/test/lit.site.cfg.py.in +++ b/lldb/test/lit.site.cfg.py.in @@ -10,7 +10,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.target_triple = "@TARGET_TRIPLE@" -config.python_executable = "@PYTHON_EXECUTABLE@" +config.python_executable = "@Python3_EXECUTABLE@" # Support substitution of the tools and libs dirs with user parameters. This is # used when we can't determine the tool dir at configuration time. diff --git a/lldb/tools/intel-features/CMakeLists.txt b/lldb/tools/intel-features/CMakeLists.txt index efba2f74904f7..e4979ad5256d9 100644 --- a/lldb/tools/intel-features/CMakeLists.txt +++ b/lldb/tools/intel-features/CMakeLists.txt @@ -56,7 +56,7 @@ add_lldb_library(lldbIntelFeatures SHARED LINK_LIBS ${FEATURE_LIBS} - ${PYTHON_LIBRARY} + ${Python3_LIBRARIES} ) # Add link dependencies for python wrapper diff --git a/lldb/tools/lldb-test/CMakeLists.txt b/lldb/tools/lldb-test/CMakeLists.txt index 2edbd8e56d6ed..562905760e2c8 100644 --- a/lldb/tools/lldb-test/CMakeLists.txt +++ b/lldb/tools/lldb-test/CMakeLists.txt @@ -24,9 +24,9 @@ add_lldb_tool(lldb-test Support ) -if(PYTHON_RPATH) - set_property(TARGET lldb-test APPEND PROPERTY INSTALL_RPATH "${PYTHON_RPATH}") - set_property(TARGET lldb-test APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}") +if(Python3_RPATH) + set_property(TARGET lldb-test APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}") + set_property(TARGET lldb-test APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}") endif() target_include_directories(lldb-test PRIVATE ${LLDB_SOURCE_DIR}/source) diff --git a/lldb/unittests/API/CMakeLists.txt b/lldb/unittests/API/CMakeLists.txt index 308249b63add1..2f066f26d8aaf 100644 --- a/lldb/unittests/API/CMakeLists.txt +++ b/lldb/unittests/API/CMakeLists.txt @@ -5,6 +5,6 @@ add_lldb_unittest(APITests liblldb ) -if(PYTHON_RPATH) - set_property(TARGET APITests APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}") +if(Python3_RPATH) + set_property(TARGET APITests APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}") endif() diff --git a/lldb/unittests/Process/Linux/CMakeLists.txt b/lldb/unittests/Process/Linux/CMakeLists.txt index 31e9a57a4e46e..bf71f2b55b85b 100644 --- a/lldb/unittests/Process/Linux/CMakeLists.txt +++ b/lldb/unittests/Process/Linux/CMakeLists.txt @@ -5,4 +5,4 @@ add_lldb_unittest(ProcessorTraceTests LINK_LIBS lldbPluginProcessLinux - ) \ No newline at end of file + ) diff --git a/lldb/unittests/ScriptInterpreter/Lua/CMakeLists.txt b/lldb/unittests/ScriptInterpreter/Lua/CMakeLists.txt index aa8a95c7c54c0..e030070a140f0 100644 --- a/lldb/unittests/ScriptInterpreter/Lua/CMakeLists.txt +++ b/lldb/unittests/ScriptInterpreter/Lua/CMakeLists.txt @@ -9,4 +9,4 @@ add_lldb_unittest(ScriptInterpreterLuaTests LLVMTestingSupport LINK_COMPONENTS Support - ) \ No newline at end of file + ) diff --git a/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt b/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt index 913bd629526d7..90a53bf175105 100644 --- a/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt +++ b/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt @@ -10,6 +10,6 @@ add_lldb_unittest(ScriptInterpreterPythonTests Support ) -if(PYTHON_RPATH) - set_property(TARGET ScriptInterpreterPythonTests APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}") -endif() \ No newline at end of file +if(Python3_RPATH) + set_property(TARGET ScriptInterpreterPythonTests APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}") +endif() diff --git a/lldb/utils/lldb-dotest/lldb-dotest.in b/lldb/utils/lldb-dotest/lldb-dotest.in index ee0ea6dff748c..f573d5bf28d42 100755 --- a/lldb/utils/lldb-dotest/lldb-dotest.in +++ b/lldb/utils/lldb-dotest/lldb-dotest.in @@ -1,4 +1,4 @@ -#!@PYTHON_EXECUTABLE@ +#!@Python3_EXECUTABLE@ import subprocess import sys