[Lldb-commits] [lldb] 0bb9062 - Allow customized relative PYTHONHOME
Author: Haibo Huang Date: 2020-02-21T12:49:10-08:00 New Revision: 0bb90628b5f7c170689d2d3f019af773772fc649 URL: https://github.com/llvm/llvm-project/commit/0bb90628b5f7c170689d2d3f019af773772fc649 DIFF: https://github.com/llvm/llvm-project/commit/0bb90628b5f7c170689d2d3f019af773772fc649.diff LOG: Allow customized relative PYTHONHOME Summary: This change allows a hard coded relative PYTHONHOME setting. So that python can easily be packaged together with lldb. The change includes: 1. Extend LLDB_RELOCATABLE_PYTHON to all platforms. It defaults to ON for platforms other than Windows, to keep the behavior compatible. 2. Allows to customize LLDB_PYTHON_HOME. But still defaults to PYTHON_HOME. 3. LLDB_PYTHON_HOME can be a path relative to liblldb. If it is relative, we will resolve it before send it to Py_DecodeLocale. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D74727 Added: Modified: lldb/cmake/modules/LLDBConfig.cmake lldb/include/lldb/Host/Config.h.cmake lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp Removed: diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index fb4512a87998..6b10f73eff19 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -59,7 +59,6 @@ add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" L add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonInterpAndLibs PYTHONINTERPANDLIBS_FOUND) add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8) -option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to locate Python." OFF) option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a copy of it" OFF) option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON) option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF) @@ -140,10 +139,20 @@ if (LLDB_ENABLE_LIBEDIT) endif() if (LLDB_ENABLE_PYTHON) + if(CMAKE_SYSTEM_NAME MATCHES "Windows") +set(default_embed_python_home ON) + else() +set(default_embed_python_home OFF) + endif() + option(LLDB_EMBED_PYTHON_HOME +"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}) - if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND NOT LLDB_RELOCATABLE_PYTHON) + if (LLDB_EMBED_PYTHON_HOME) get_filename_component(PYTHON_HOME "${PYTHON_EXECUTABLE}" DIRECTORY) -file(TO_CMAKE_PATH "${PYTHON_HOME}" LLDB_PYTHON_HOME) +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() endif() diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake index e9065ed04caa..42f4ca1a26c6 100644 --- a/lldb/include/lldb/Host/Config.h.cmake +++ b/lldb/include/lldb/Host/Config.h.cmake @@ -46,6 +46,8 @@ #cmakedefine01 LLDB_ENABLE_PYTHON +#cmakedefine01 LLDB_EMBED_PYTHON_HOME + #cmakedefine LLDB_PYTHON_HOME "${LLDB_PYTHON_HOME}" #define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 722af713ba43..f046bcfd18eb 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -277,14 +277,36 @@ struct InitializePythonRAII { private: void InitializePythonHome() { -#if defined(LLDB_PYTHON_HOME) +#if LLDB_EMBED_PYTHON_HOME #if PY_MAJOR_VERSION >= 3 -size_t size = 0; -static wchar_t *g_python_home = Py_DecodeLocale(LLDB_PYTHON_HOME, &size); +typedef const wchar_t* str_type; #else -static char g_python_home[] = LLDB_PYTHON_HOME; +typedef char* str_type; #endif -Py_SetPythonHome(g_python_home); +static str_type g_python_home = []() -> str_type { + const char *lldb_python_home = LLDB_PYTHON_HOME; + const char *absolute_python_home = nullptr; + llvm::SmallString<64> path; + if (llvm::sys::path::is_absolute(lldb_python_home)) { +absolute_python_home = lldb_python_home; + } else { +FileSpec spec = HostInfo::GetShlibDir(); +if (!spec) + return nullptr; +spec.GetPath(path); +llvm::sys::path::append(path, lldb_python_home); +absolute_python_home = path.c_str(); + } +#if PY_MAJOR_VERSION >= 3 + size_t size = 0; + return Py_DecodeLocale(absolute_python_home, &size); +#else +
[Lldb-commits] [lldb] 3ec3f62 - Allow customized relative PYTHONHOME (Attemp 1)
Author: Haibo Huang Date: 2020-02-21T16:25:30-08:00 New Revision: 3ec3f62f0a0b1ac13230922c91ffc988c1b1e8d5 URL: https://github.com/llvm/llvm-project/commit/3ec3f62f0a0b1ac13230922c91ffc988c1b1e8d5 DIFF: https://github.com/llvm/llvm-project/commit/3ec3f62f0a0b1ac13230922c91ffc988c1b1e8d5.diff LOG: Allow customized relative PYTHONHOME (Attemp 1) Summary: This is another attempt of 0bb90628b5f7c170689d2d3f019af773772fc649. The difference is that g_python_home is not declared as const. Since some versions of python do not expect that. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D74998 Added: Modified: lldb/cmake/modules/LLDBConfig.cmake lldb/include/lldb/Host/Config.h.cmake lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp Removed: diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index fb4512a87998..6b10f73eff19 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -59,7 +59,6 @@ add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" L add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonInterpAndLibs PYTHONINTERPANDLIBS_FOUND) add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8) -option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to locate Python." OFF) option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a copy of it" OFF) option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON) option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF) @@ -140,10 +139,20 @@ if (LLDB_ENABLE_LIBEDIT) endif() if (LLDB_ENABLE_PYTHON) + if(CMAKE_SYSTEM_NAME MATCHES "Windows") +set(default_embed_python_home ON) + else() +set(default_embed_python_home OFF) + endif() + option(LLDB_EMBED_PYTHON_HOME +"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}) - if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND NOT LLDB_RELOCATABLE_PYTHON) + if (LLDB_EMBED_PYTHON_HOME) get_filename_component(PYTHON_HOME "${PYTHON_EXECUTABLE}" DIRECTORY) -file(TO_CMAKE_PATH "${PYTHON_HOME}" LLDB_PYTHON_HOME) +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() endif() diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake index e9065ed04caa..42f4ca1a26c6 100644 --- a/lldb/include/lldb/Host/Config.h.cmake +++ b/lldb/include/lldb/Host/Config.h.cmake @@ -46,6 +46,8 @@ #cmakedefine01 LLDB_ENABLE_PYTHON +#cmakedefine01 LLDB_EMBED_PYTHON_HOME + #cmakedefine LLDB_PYTHON_HOME "${LLDB_PYTHON_HOME}" #define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 722af713ba43..3e93ddbf18c8 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -277,14 +277,36 @@ struct InitializePythonRAII { private: void InitializePythonHome() { -#if defined(LLDB_PYTHON_HOME) +#if LLDB_EMBED_PYTHON_HOME #if PY_MAJOR_VERSION >= 3 -size_t size = 0; -static wchar_t *g_python_home = Py_DecodeLocale(LLDB_PYTHON_HOME, &size); +typedef wchar_t* str_type; #else -static char g_python_home[] = LLDB_PYTHON_HOME; +typedef char* str_type; #endif -Py_SetPythonHome(g_python_home); +static str_type g_python_home = []() -> str_type { + const char *lldb_python_home = LLDB_PYTHON_HOME; + const char *absolute_python_home = nullptr; + llvm::SmallString<64> path; + if (llvm::sys::path::is_absolute(lldb_python_home)) { +absolute_python_home = lldb_python_home; + } else { +FileSpec spec = HostInfo::GetShlibDir(); +if (!spec) + return nullptr; +spec.GetPath(path); +llvm::sys::path::append(path, lldb_python_home); +absolute_python_home = path.c_str(); + } +#if PY_MAJOR_VERSION >= 3 + size_t size = 0; + return Py_DecodeLocale(absolute_python_home, &size); +#else + return strdup(absolute_python_home); +#endif +}(); +if (g_python_home != nullptr) { + Py_SetPythonHome(g_python_home); +} #else #if defined(__APPLE__) && PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION == 7 // For Darwin, the only Python version supported is the one shipp
[Lldb-commits] [lldb] r373668 - [lldb] Calculate relative path for symbol links
Author: hhb Date: Thu Oct 3 14:52:20 2019 New Revision: 373668 URL: http://llvm.org/viewvc/llvm-project?rev=373668&view=rev Log: [lldb] Calculate relative path for symbol links Summary: This replaces the hard coded path. Reviewers: labath, mgorny Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67993 Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=373668&r1=373667&r2=373668&view=diff == --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original) +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Thu Oct 3 14:52:20 2019 @@ -365,7 +365,6 @@ def make_symlink_native(vDictArgs, strSr # Throws: None. #-- - def make_symlink( vDictArgs, vstrFrameworkPythonDir, @@ -377,27 +376,15 @@ def make_symlink( bDbg = "-d" in vDictArgs strTarget = os.path.join(vstrFrameworkPythonDir, vstrTargetFile) strTarget = os.path.normcase(strTarget) -strSrc = "" +strPrefix = vDictArgs['--prefix'] os.chdir(vstrFrameworkPythonDir) bMakeFileCalled = "-m" in vDictArgs eOSType = utilsOsType.determine_os_type() -if not bMakeFileCalled: -strBuildDir = os.path.join("..", "..", "..") -else: -# Resolve vstrSrcFile path relatively the build directory -if eOSType == utilsOsType.EnumOsType.Windows: -# On a Windows platform the vstrFrameworkPythonDir looks like: -# llvm\\build\\Lib\\site-packages\\lldb -strBuildDir = os.path.join("..", "..", "..") -else: -# On a UNIX style platform the vstrFrameworkPythonDir looks like: -# llvm/build/lib/python2.7/site-packages/lldb -strBuildDir = os.path.join("..", "..", "..", "..") -strSrc = os.path.normcase(os.path.join(strBuildDir, vstrSrcFile)) - -return make_symlink_native(vDictArgs, strSrc, strTarget) +strSrc = os.path.normcase(os.path.join(strPrefix, vstrSrcFile)) +strRelSrc = os.path.relpath(strSrc, os.path.dirname(strTarget)) +return make_symlink_native(vDictArgs, strRelSrc, strTarget) #++--- # Details: Make the symbolic that the script bridge for Python will need in ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r368125 - Detect HAVE_SYS_TYPES_H in lldb
Author: hhb Date: Tue Aug 6 23:15:01 2019 New Revision: 368125 URL: http://llvm.org/viewvc/llvm-project?rev=368125&view=rev Log: Detect HAVE_SYS_TYPES_H in lldb Summary: After rL368069 I noticed that HAVE_SYS_TYPES_H is not defined in Platform.h, or anywhere else in lldb. This change fixes that. Reviewers: labath Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65822 Modified: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake lldb/trunk/include/lldb/Host/Config.h.cmake lldb/trunk/include/lldb/Host/windows/PosixApi.h lldb/trunk/source/Expression/UserExpression.cpp lldb/trunk/source/Expression/UtilityFunction.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp lldb/trunk/tools/driver/Platform.h Modified: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake?rev=368125&r1=368124&r2=368125&view=diff == --- lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake Tue Aug 6 23:15:01 2019 @@ -12,6 +12,7 @@ check_symbol_exists(sigaction signal.h H check_cxx_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4) check_include_file(termios.h HAVE_TERMIOS_H) +check_include_file("sys/types.h" HAVE_SYS_TYPES_H) check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H) check_cxx_symbol_exists(process_vm_readv "sys/uio.h" HAVE_PROCESS_VM_READV) Modified: lldb/trunk/include/lldb/Host/Config.h.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=368125&r1=368124&r2=368125&view=diff == --- lldb/trunk/include/lldb/Host/Config.h.cmake (original) +++ lldb/trunk/include/lldb/Host/Config.h.cmake Tue Aug 6 23:15:01 2019 @@ -19,6 +19,8 @@ #define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" +#cmakedefine01 HAVE_SYS_TYPES_H + #cmakedefine01 HAVE_SYS_EVENT_H #cmakedefine01 HAVE_PPOLL Modified: lldb/trunk/include/lldb/Host/windows/PosixApi.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/PosixApi.h?rev=368125&r1=368124&r2=368125&view=diff == --- lldb/trunk/include/lldb/Host/windows/PosixApi.h (original) +++ lldb/trunk/include/lldb/Host/windows/PosixApi.h Tue Aug 6 23:15:01 2019 @@ -9,6 +9,7 @@ #ifndef liblldb_Host_windows_PosixApi_h #define liblldb_Host_windows_PosixApi_h +#include "lldb/Host/Config.h" #include "llvm/Support/Compiler.h" #if !defined(_WIN32) #error "windows/PosixApi.h being #included on non Windows system!" @@ -45,14 +46,14 @@ #define S_IRWXG 0 #define S_IRWXO 0 -#ifdef __MINGW32__ +#if HAVE_SYS_TYPES_H // pyconfig.h typedefs this. We require python headers to be included before // any LLDB headers, but there's no way to prevent python's pid_t definition // from leaking, so this is the best option. #ifndef NO_PID_T #include #endif -#endif // __MINGW32__ +#endif // HAVE_SYS_TYPES_H #ifdef _MSC_VER Modified: lldb/trunk/source/Expression/UserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/UserExpression.cpp?rev=368125&r1=368124&r2=368125&view=diff == --- lldb/trunk/source/Expression/UserExpression.cpp (original) +++ lldb/trunk/source/Expression/UserExpression.cpp Tue Aug 6 23:15:01 2019 @@ -6,6 +6,8 @@ // //===--===// +#include "lldb/Host/Config.h" + #include #if HAVE_SYS_TYPES_H #include Modified: lldb/trunk/source/Expression/UtilityFunction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/UtilityFunction.cpp?rev=368125&r1=368124&r2=368125&view=diff == --- lldb/trunk/source/Expression/UtilityFunction.cpp (original) +++ lldb/trunk/source/Expression/UtilityFunction.cpp Tue Aug 6 23:15:01 2019 @@ -6,6 +6,8 @@ // //===--===// +#include "lldb/Host/Config.h" + #include #if HAVE_SYS_TYPES_H #include Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp?rev=368125&r1=368124&r2=368125&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp Tue Aug 6 23
[Lldb-commits] [lldb] r368352 - [lldb] Fix HAVE_LIBCOMPRESSION
Author: hhb Date: Thu Aug 8 14:42:33 2019 New Revision: 368352 URL: http://llvm.org/viewvc/llvm-project?rev=368352&view=rev Log: [lldb] Fix HAVE_LIBCOMPRESSION Summary: This test doesn't make sense. Change to be consistent with what we did in GDBRemoteCommunication.cpp. Reviewers: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65965 Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=368352&r1=368351&r2=368352&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Thu Aug 8 14:42:33 2019 @@ -14,6 +14,7 @@ #include #include "lldb/Core/StreamFile.h" +#include "lldb/Host/Config.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=368352&r1=368351&r2=368352&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Aug 8 14:42:33 2019 @@ -36,10 +36,7 @@ #include "llvm/ADT/StringSwitch.h" -#if defined(__APPLE__) -#ifndef HAVE_LIBCOMPRESSION -#define HAVE_LIBCOMPRESSION -#endif +#if defined(HAVE_LIBCOMPRESSION) #include #endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r372895 - [lldb] Move swig call from python code to cmake
Author: hhb Date: Wed Sep 25 09:37:11 2019 New Revision: 372895 URL: http://llvm.org/viewvc/llvm-project?rev=372895&view=rev Log: [lldb] Move swig call from python code to cmake Summary: Elimiates lots of unused code. Reviewers: labath, mgorny Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68007 Removed: lldb/trunk/scripts/Python/prepare_binding_Python.py lldb/trunk/scripts/prepare_bindings.py Modified: lldb/trunk/scripts/CMakeLists.txt Modified: lldb/trunk/scripts/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/CMakeLists.txt?rev=372895&r1=372894&r2=372895&view=diff == --- lldb/trunk/scripts/CMakeLists.txt (original) +++ lldb/trunk/scripts/CMakeLists.txt Wed Sep 25 09:37:11 2019 @@ -1,12 +1,8 @@ file(GLOB SWIG_INTERFACES interface/*.i) file(GLOB_RECURSE SWIG_SOURCES *.swig) -set(SWIG_HEADERS - ${LLDB_SOURCE_DIR}/include/lldb/API/SBDefines.h - ${LLDB_SOURCE_DIR}/include/lldb/lldb-defines.h - ${LLDB_SOURCE_DIR}/include/lldb/lldb-enumerations.h - ${LLDB_SOURCE_DIR}/include/lldb/lldb-forward.h - ${LLDB_SOURCE_DIR}/include/lldb/lldb-types.h - ${LLDB_SOURCE_DIR}/include/lldb/lldb-versioning.h +file(GLOB SWIG_HEADERS + ${LLDB_SOURCE_DIR}/include/lldb/API/*.h + ${LLDB_SOURCE_DIR}/include/lldb/*.h ) if(LLDB_BUILD_FRAMEWORK) @@ -19,22 +15,34 @@ if (${SWIG_VERSION} VERSION_LESS ${SWIG_ message(FATAL_ERROR "LLDB requires swig ${SWIG_MIN_VERSION}, your version is ${SWIG_VERSION}.") endif() +if(APPLE) + set(DARWIN_EXTRAS "-D__APPLE__") +else() + set(DARWIN_EXTRAS "") +endif() + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lldb.py DEPENDS ${SWIG_SOURCES} DEPENDS ${SWIG_INTERFACES} DEPENDS ${SWIG_HEADERS} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Python/prepare_binding_Python.py - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/prepare_bindings.py - ${framework_arg} - --srcRoot=${LLDB_SOURCE_DIR} - --targetDir=${CMAKE_CURRENT_BINARY_DIR} - --cfgBldDir=${CMAKE_CURRENT_BINARY_DIR} - --prefix=${CMAKE_BINARY_DIR} - --swigExecutable=${SWIG_EXECUTABLE} + COMMAND ${SWIG_EXECUTABLE} + -c++ + -shadow + -python + -features autodoc + -threads + -I${LLDB_SOURCE_DIR}/include + -I${CMAKE_CURRENT_SOURCE_DIR} + -D__STDC_LIMIT_MACROS + -D__STDC_CONSTANT_MACROS + ${DARWIN_EXTRAS} + -outdir ${CMAKE_CURRENT_BINARY_DIR} + -o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp + ${LLDB_SOURCE_DIR}/scripts/lldb.swig VERBATIM - COMMENT "Python script building LLDB Python wrapper") + COMMENT "Builds LLDB Python wrapper") add_custom_target(swig_wrapper ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp Removed: lldb/trunk/scripts/Python/prepare_binding_Python.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/prepare_binding_Python.py?rev=372894&view=auto == --- lldb/trunk/scripts/Python/prepare_binding_Python.py (original) +++ lldb/trunk/scripts/Python/prepare_binding_Python.py (removed) @@ -1,396 +0,0 @@ -""" -Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -See https://llvm.org/LICENSE.txt for license information. -SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -Python binding preparation script. -""" - -# Python modules: -from __future__ import print_function - -import logging -import os -import re -import shutil -import subprocess -import sys -import platform - - -class SwigSettings(object): -"""Provides a single object to represent swig files and settings.""" - -def __init__(self): -self.extensions_file = None -self.header_files = None -self.input_file = None -self.interface_files = None -self.output_file = None -self.safecast_file = None -self.typemaps_file = None -self.wrapper_file = None - -@classmethod -def _any_files_newer(cls, files, check_mtime): -"""Returns if any of the given files has a newer modified time. - -@param cls the class -@param files a list of zero or more file paths to check -@param check_mtime the modification time to use as a reference. - -@return True if any file's modified time is newer than check_mtime. -""" -for path in files: -path_mtime = os.path.getmtime(path) -if path_mtime > check_mtime: -# This path was modified more recently than the -# check_mtime. -return True -# If we made it here, nothing was newer than the check_mtime -return False - -@classmethod -def _file_newer(cls, path, check_mtime): -"""Tests how recently a file has been modified. - -@para
[Lldb-commits] [lldb] r368496 - Detects whether RESOURCE_TYPE_IO is defined.
Author: hhb Date: Fri Aug 9 15:47:46 2019 New Revision: 368496 URL: http://llvm.org/viewvc/llvm-project?rev=368496&view=rev Log: Detects whether RESOURCE_TYPE_IO is defined. Summary: This fixes lldb build on macOS SDK prior to 10.12. Reviewers: JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66034 Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=368496&r1=368495&r2=368496&view=diff == --- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Fri Aug 9 15:47:46 2019 @@ -313,6 +313,8 @@ const char *StopInfoMachException::GetDe subcode_desc = nullptr; subcode_label = "unused"; break; +#if defined(RESOURCE_TYPE_IO) + // RESOURCE_TYPE_IO is introduced in macOS SDK 10.12. case RESOURCE_TYPE_IO: exc_desc = "EXC_RESOURCE RESOURCE_TYPE_IO"; snprintf(code_desc_buf, sizeof(code_desc_buf), "%d MB", @@ -320,6 +322,7 @@ const char *StopInfoMachException::GetDe snprintf(subcode_desc_buf, sizeof(subcode_desc_buf), "%d MB", (int)EXC_RESOURCE_IO_OBSERVED(m_exc_subcode));; break; +#endif } } #endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r372194 - Cache PYTHON_EXECUTABLE for windows
Author: hhb Date: Tue Sep 17 18:00:12 2019 New Revision: 372194 URL: http://llvm.org/viewvc/llvm-project?rev=372194&view=rev Log: Cache PYTHON_EXECUTABLE for windows Summary: This way it can be overwritten when cross compiling. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67641 Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=372194&r1=372193&r2=372194&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Sep 17 18:00:12 2019 @@ -250,10 +250,10 @@ function(find_python_libs_windows) endif() # Set the same variables as FindPythonInterp and FindPythonLibs. - set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}" PARENT_SCOPE) - set(PYTHON_LIBRARY"${PYTHON_LIBRARY}" PARENT_SCOPE) - set(PYTHON_DLL"${PYTHON_DLL}" PARENT_SCOPE) - set(PYTHON_INCLUDE_DIR"${PYTHON_INCLUDE_DIR}" PARENT_SCOPE) + set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}" CACHE PATH "") + set(PYTHON_LIBRARY"${PYTHON_LIBRARY}" CACHE PATH "") + set(PYTHON_DLL"${PYTHON_DLL}" CACHE PATH "") + set(PYTHON_INCLUDE_DIR"${PYTHON_INCLUDE_DIR}" CACHE PATH "") set(PYTHONLIBS_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}" PARENT_SCOPE) set(PYTHON_VERSION_STRING "${PYTHON_VERSION_STRING}" PARENT_SCOPE) set(PYTHON_VERSION_MAJOR "${PYTHON_VERSION_MAJOR}" PARENT_SCOPE) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r372364 - Revert "Fix swig python package path"
Author: hhb Date: Thu Sep 19 17:45:26 2019 New Revision: 372364 URL: http://llvm.org/viewvc/llvm-project?rev=372364&view=rev Log: Revert "Fix swig python package path" Summary: This reverts commit 5a115e81cdd40c758b10c382aeffc0c8de6930e2. Reviewers: JDevlieghere, ZeGentzy Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67781 Modified: lldb/trunk/scripts/CMakeLists.txt Modified: lldb/trunk/scripts/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/CMakeLists.txt?rev=372364&r1=372363&r2=372364&view=diff == --- lldb/trunk/scripts/CMakeLists.txt (original) +++ lldb/trunk/scripts/CMakeLists.txt Thu Sep 19 17:45:26 2019 @@ -42,15 +42,13 @@ add_custom_target(swig_wrapper ALL DEPEN ) if(NOT LLDB_BUILD_FRAMEWORK) - # The path here should match the result of python function - # distutils.sysconfig.get_python_lib(). - if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") -set(swig_python_subdir Lib/site-packages) + if(CMAKE_SYSTEM_NAME MATCHES "Windows") +set(swig_python_subdir site-packages) else() -set(swig_python_subdir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +set(swig_python_subdir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) endif() - set(SWIG_PYTHON_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${swig_python_subdir}) + set(SWIG_PYTHON_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${swig_python_subdir}) set(SWIG_INSTALL_DIR lib${LLVM_LIBDIR_SUFFIX}) # Install the LLDB python module ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r367273 - [CMake] Move project() call to main CMake file
Author: hhb Date: Mon Jul 29 16:09:31 2019 New Revision: 367273 URL: http://llvm.org/viewvc/llvm-project?rev=367273&view=rev Log: [CMake] Move project() call to main CMake file Summary: The main CMake file don't have a project() call. In this case, cmake will run a dummy project(Project ) at the very beginning. Even before cmake_minimum_required. And a series of compiler detections will be triggered. This is problematic if we depends on some policy to be set. E.g. CMP0056. try_compile will fail before we have a chance to do anything. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65362 Modified: lldb/trunk/CMakeLists.txt lldb/trunk/cmake/modules/LLDBStandalone.cmake Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=367273&r1=367272&r2=367273&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Mon Jul 29 16:09:31 2019 @@ -14,6 +14,7 @@ set(CMAKE_MODULE_PATH # If we are not building as part of LLVM, build LLDB as a standalone project, # using LLVM as an external library. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(lldb) include(LLDBStandalone) endif() Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=367273&r1=367272&r2=367273&view=diff == --- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original) +++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Mon Jul 29 16:09:31 2019 @@ -1,5 +1,3 @@ -project(lldb) - option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF) find_package(LLVM REQUIRED CONFIG HINTS "${LLVM_DIR}" NO_CMAKE_FIND_ROOT_PATH) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r373669 - [lldb] Remove unused variables.
Author: hhb Date: Thu Oct 3 14:56:59 2019 New Revision: 373669 URL: http://llvm.org/viewvc/llvm-project?rev=373669&view=rev Log: [lldb] Remove unused variables. Fixes the comment in https://reviews.llvm.org/D67993 Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=373669&r1=373668&r2=373669&view=diff == --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original) +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Thu Oct 3 14:56:59 2019 @@ -371,16 +371,11 @@ def make_symlink( vstrSrcFile, vstrTargetFile): dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink()") -bOk = True -strErrMsg = "" -bDbg = "-d" in vDictArgs strTarget = os.path.join(vstrFrameworkPythonDir, vstrTargetFile) strTarget = os.path.normcase(strTarget) strPrefix = vDictArgs['--prefix'] os.chdir(vstrFrameworkPythonDir) -bMakeFileCalled = "-m" in vDictArgs -eOSType = utilsOsType.determine_os_type() strSrc = os.path.normcase(os.path.join(strPrefix, vstrSrcFile)) strRelSrc = os.path.relpath(strSrc, os.path.dirname(strTarget)) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r368069 - Various build fixes for lldb on MinGW
Author: hhb Date: Tue Aug 6 11:20:43 2019 New Revision: 368069 URL: http://llvm.org/viewvc/llvm-project?rev=368069&view=rev Log: Various build fixes for lldb on MinGW Subscribers: mstorsjo, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65691 Modified: lldb/trunk/include/lldb/Host/windows/PosixApi.h lldb/trunk/source/Host/windows/FileSystem.cpp lldb/trunk/source/Initialization/SystemInitializerCommon.cpp lldb/trunk/tools/driver/Platform.h lldb/trunk/tools/lldb-vscode/VSCode.cpp lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp Modified: lldb/trunk/include/lldb/Host/windows/PosixApi.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/PosixApi.h?rev=368069&r1=368068&r2=368069&view=diff == --- lldb/trunk/include/lldb/Host/windows/PosixApi.h (original) +++ lldb/trunk/include/lldb/Host/windows/PosixApi.h Tue Aug 6 11:20:43 2019 @@ -45,6 +45,15 @@ #define S_IRWXG 0 #define S_IRWXO 0 +#ifdef __MINGW32__ +// pyconfig.h typedefs this. We require python headers to be included before +// any LLDB headers, but there's no way to prevent python's pid_t definition +// from leaking, so this is the best option. +#ifndef NO_PID_T +#include +#endif +#endif // __MINGW32__ + #ifdef _MSC_VER // PRIxxx format macros for printf() @@ -80,12 +89,16 @@ int vasprintf(char **ret, const char *fm char *strcasestr(const char *s, const char *find); char *realpath(const char *name, char *resolved); +#ifdef _MSC_VER + char *basename(char *path); char *dirname(char *path); int strcasecmp(const char *s1, const char *s2); int strncasecmp(const char *s1, const char *s2, size_t n); +#endif // _MSC_VER + // empty functions inline int posix_openpt(int flag) { LLVM_BUILTIN_UNREACHABLE; } Modified: lldb/trunk/source/Host/windows/FileSystem.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/FileSystem.cpp?rev=368069&r1=368068&r2=368069&view=diff == --- lldb/trunk/source/Host/windows/FileSystem.cpp (original) +++ lldb/trunk/source/Host/windows/FileSystem.cpp Tue Aug 6 11:20:43 2019 @@ -8,6 +8,7 @@ #include "lldb/Host/windows/windows.h" +#include #include #include #include Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=368069&r1=368068&r2=368069&view=diff == --- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original) +++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Tue Aug 6 11:20:43 2019 @@ -25,6 +25,7 @@ #if defined(_WIN32) #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h" #include "lldb/Host/windows/windows.h" +#include #endif #include "llvm/Support/TargetSelect.h" Modified: lldb/trunk/tools/driver/Platform.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Platform.h?rev=368069&r1=368068&r2=368069&view=diff == --- lldb/trunk/tools/driver/Platform.h (original) +++ lldb/trunk/tools/driver/Platform.h Tue Aug 6 11:20:43 2019 @@ -15,6 +15,9 @@ #if defined(_MSC_VER) #include #endif +#if HAVE_SYS_TYPES_H +#include +#endif #include "lldb/Host/windows/windows.h" #include Modified: lldb/trunk/tools/lldb-vscode/VSCode.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/VSCode.cpp?rev=368069&r1=368068&r2=368069&view=diff == --- lldb/trunk/tools/lldb-vscode/VSCode.cpp (original) +++ lldb/trunk/tools/lldb-vscode/VSCode.cpp Tue Aug 6 11:20:43 2019 @@ -15,8 +15,10 @@ #include "llvm/Support/FormatVariadic.h" #if defined(_WIN32) +#ifndef __MINGW32__ #define NOMINMAX #include +#endif // __MINGW32__ #include #include #endif Modified: lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp?rev=368069&r1=368068&r2=368069&view=diff == --- lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp (original) +++ lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp Tue Aug 6 11:20:43 2019 @@ -50,7 +50,9 @@ #include "VSCode.h" #if defined(_WIN32) +#ifndef PATH_MAX #define PATH_MAX MAX_PATH +#endif typedef int socklen_t; constexpr const char *dev_null_path = "nul"; ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r372493 - Use _WIN32 instead of _MSC_VER
Author: hhb Date: Sat Sep 21 18:21:34 2019 New Revision: 372493 URL: http://llvm.org/viewvc/llvm-project?rev=372493&view=rev Log: Use _WIN32 instead of _MSC_VER Summary: This way it works better with MinGW. Subscribers: mstorsjo, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67887 Modified: lldb/trunk/source/Core/IOHandler.cpp Modified: lldb/trunk/source/Core/IOHandler.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/IOHandler.cpp?rev=372493&r1=372492&r2=372493&view=diff == --- lldb/trunk/source/Core/IOHandler.cpp (original) +++ lldb/trunk/source/Core/IOHandler.cpp Sat Sep 21 18:21:34 2019 @@ -52,7 +52,7 @@ #include "llvm/ADT/StringRef.h" -#ifdef _MSC_VER +#ifdef _WIN32 #include "lldb/Host/windows/windows.h" #endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r372047 - Fix swig python package path
Author: hhb Date: Mon Sep 16 16:31:16 2019 New Revision: 372047 URL: http://llvm.org/viewvc/llvm-project?rev=372047&view=rev Log: Fix swig python package path Summary: The path defined in CMakeLists.txt doesn't match the path generated in our python script. This change fixes that. LLVM_LIBRARY_OUTPUT_INTDIR is defined as: ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) On the other hand, the path of site-package is generaged in get_framework_python_dir_windows() in finishSwigPythonLLDB.py as: (Dispite its name, the function is used for everything other than xcode) prefix/cmakeBuildConfiguration/distutils.sysconfig.get_python_lib() From lldb/CMakeLists.txt, we can see that: prefix=${CMAKE_BINARY_DIR}, cmakeBuildConfiguration=${CMAKE_CFG_INTDIR} And from python source code, we can see get_python_lib() always returns lib/pythonx.y/site-packages for posix, or Lib/site-packages for windows: https://github.com/python/cpython/blob/3.8/Lib/distutils/sysconfig.py#L128 We should make them match each other. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67583 Modified: lldb/trunk/scripts/CMakeLists.txt Modified: lldb/trunk/scripts/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/CMakeLists.txt?rev=372047&r1=372046&r2=372047&view=diff == --- lldb/trunk/scripts/CMakeLists.txt (original) +++ lldb/trunk/scripts/CMakeLists.txt Mon Sep 16 16:31:16 2019 @@ -42,13 +42,15 @@ add_custom_target(swig_wrapper ALL DEPEN ) if(NOT LLDB_BUILD_FRAMEWORK) - if(CMAKE_SYSTEM_NAME MATCHES "Windows") -set(swig_python_subdir site-packages) + # The path here should match the result of python function + # distutils.sysconfig.get_python_lib(). + if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") +set(swig_python_subdir Lib/site-packages) else() -set(swig_python_subdir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +set(swig_python_subdir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) endif() - set(SWIG_PYTHON_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${swig_python_subdir}) + set(SWIG_PYTHON_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${swig_python_subdir}) set(SWIG_INSTALL_DIR lib${LLVM_LIBDIR_SUFFIX}) # Install the LLDB python module ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r372905 - [lldb] Excludes private headers from SWIG dependency.
Author: hhb Date: Wed Sep 25 11:17:45 2019 New Revision: 372905 URL: http://llvm.org/viewvc/llvm-project?rev=372905&view=rev Log: [lldb] Excludes private headers from SWIG dependency. Reviewers: xiaobai Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68040 Modified: lldb/trunk/scripts/CMakeLists.txt Modified: lldb/trunk/scripts/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/CMakeLists.txt?rev=372905&r1=372904&r2=372905&view=diff == --- lldb/trunk/scripts/CMakeLists.txt (original) +++ lldb/trunk/scripts/CMakeLists.txt Wed Sep 25 11:17:45 2019 @@ -4,6 +4,12 @@ file(GLOB SWIG_HEADERS ${LLDB_SOURCE_DIR}/include/lldb/API/*.h ${LLDB_SOURCE_DIR}/include/lldb/*.h ) +file(GLOB SWIG_PRIVATE_HEADERS + ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h +) +foreach(private_header ${SWIG_PRIVATE_HEADERS}) + list(REMOVE_ITEM SWIG_HEADERS ${private_header}) +endforeach() if(LLDB_BUILD_FRAMEWORK) set(framework_arg --framework --target-platform Darwin) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r368497 - Small format fix
Author: hhb Date: Fri Aug 9 15:59:56 2019 New Revision: 368497 URL: http://llvm.org/viewvc/llvm-project?rev=368497&view=rev Log: Small format fix Differential Revision: https://reviews.llvm.org/D66034 Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=368497&r1=368496&r2=368497&view=diff == --- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Fri Aug 9 15:59:56 2019 @@ -314,7 +314,7 @@ const char *StopInfoMachException::GetDe subcode_label = "unused"; break; #if defined(RESOURCE_TYPE_IO) - // RESOURCE_TYPE_IO is introduced in macOS SDK 10.12. +// RESOURCE_TYPE_IO is introduced in macOS SDK 10.12. case RESOURCE_TYPE_IO: exc_desc = "EXC_RESOURCE RESOURCE_TYPE_IO"; snprintf(code_desc_buf, sizeof(code_desc_buf), "%d MB", ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r373991 - [lldb] Unifying lldb python path
Author: hhb Date: Mon Oct 7 16:49:01 2019 New Revision: 373991 URL: http://llvm.org/viewvc/llvm-project?rev=373991&view=rev Log: [lldb] Unifying lldb python path Based on mgorny@'s D67890 There are 3 places where python site-package path is calculated independently: 1. finishSwigPythonLLDB.py where files are written to site-packages. 2. lldb/scripts/CMakeLists.txt where site-packages are installed. 3. ScriptInterpreterPython.cpp where site-packages are added to PYTHONPATH. This change creates the path once and use it everywhere. So that they will not go out of sync. Also it provides a chance for cross compiling users to specify the right path for site-packages. Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68442 Removed: lldb/trunk/scripts/get_relative_lib_dir.py Modified: lldb/trunk/CMakeLists.txt lldb/trunk/scripts/CMakeLists.txt lldb/trunk/scripts/Python/finishSwigPythonLLDB.py lldb/trunk/scripts/finishSwigWrapperClasses.py lldb/trunk/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=373991&r1=373990&r2=373991&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Mon Oct 7 16:49:01 2019 @@ -37,6 +37,16 @@ if (WIN32) endif() if (NOT LLDB_DISABLE_PYTHON) + execute_process( +COMMAND ${PYTHON_EXECUTABLE} +-c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(False, False, ''))" +OUTPUT_VARIABLE LLDB_PYTHON_DEFAULT_RELATIVE_PATH +OUTPUT_STRIP_TRAILING_WHITESPACE) + + file(TO_CMAKE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH} LLDB_PYTHON_DEFAULT_RELATIVE_PATH) + set(LLDB_PYTHON_RELATIVE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH} +CACHE STRING "Path where Python modules are installed, relative to install prefix") + add_subdirectory(scripts) endif () @@ -195,6 +205,12 @@ if (NOT LLDB_DISABLE_PYTHON) get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR) get_target_property(liblldb_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) +if(LLDB_BUILD_FRAMEWORK) + set(lldb_python_build_path "${liblldb_build_dir}/LLDB.framework/Resources/Python/lldb") +else() + set(lldb_python_build_path "${CMAKE_BINARY_DIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") +endif() + # Add a Post-Build Event to copy over Python files and create the symlink # to liblldb.so for the Python API(hardlink on Windows). add_custom_target(finish_swig ALL @@ -206,6 +222,7 @@ if (NOT LLDB_DISABLE_PYTHON) --prefix=${CMAKE_BINARY_DIR} --cmakeBuildConfiguration=${CMAKE_CFG_INTDIR} --lldbLibDir=lib${LLVM_LIBDIR_SUFFIX} + --lldbPythonPath=${lldb_python_build_path} ${use_python_wrapper_from_src_dir} ${use_six_py_from_system} VERBATIM @@ -219,6 +236,20 @@ if (NOT LLDB_DISABLE_PYTHON) # Ensure we do the python post-build step when building lldb. add_dependencies(lldb finish_swig) +if(NOT LLDB_BUILD_FRAMEWORK) + # Install the LLDB python module + add_custom_target(lldb-python-scripts) + add_dependencies(lldb-python-scripts finish_swig) + install(DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_PYTHON_RELATIVE_PATH}/ + DESTINATION ${LLDB_PYTHON_RELATIVE_PATH} + COMPONENT lldb-scripts) + if (NOT LLVM_ENABLE_IDE) +add_llvm_install_targets(install-lldb-python-scripts + COMPONENT lldb-python-scripts + DEPENDS lldb-python-scripts) + endif() +endif() + # Add a Post-Build Event to copy the custom Python DLL to the lldb binaries dir so that Windows can find it when launching # lldb.exe or any other executables that were linked with liblldb. if (WIN32 AND NOT "${PYTHON_DLL}" STREQUAL "") Modified: lldb/trunk/scripts/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/CMakeLists.txt?rev=373991&r1=373990&r2=373991&view=diff == --- lldb/trunk/scripts/CMakeLists.txt (original) +++ lldb/trunk/scripts/CMakeLists.txt Mon Oct 7 16:49:01 2019 @@ -55,28 +55,3 @@ add_custom_target(swig_wrapper ALL DEPEN ${CMAKE_CURRENT_BINARY_DIR}/lldb.py ) -if(NOT LLDB_BUILD_FRAMEWORK) - execute_process( -COMMAND ${PYTHON_EXECUTABLE} --c "import distutils.sysconfig, sys; print(distutils.sysconfig.get_python_lib(True, False, sys.argv[1]))" -${CMAKE_BINARY_DIR} -OUTPUT_VARIABLE SWIG_PYTHON_DIR -OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process( -COMMAND
[Lldb-commits] [lldb] r373998 - [lldb] Reverts part of 61f471a
Author: hhb Date: Mon Oct 7 17:33:26 2019 New Revision: 373998 URL: http://llvm.org/viewvc/llvm-project?rev=373998&view=rev Log: [lldb] Reverts part of 61f471a Seems I wrongly merged an old patch. Reverts the change related to python dir for windows. FileSpec should always contain normalized path. I.e. using '/' even in windows. Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=373998&r1=373997&r2=373998&view=diff == --- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (original) +++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp Mon Oct 7 17:33:26 2019 @@ -319,6 +319,12 @@ void ScriptInterpreterPython::ComputePyt // x86_64, or bin on Windows). llvm::sys::path::remove_filename(path); llvm::sys::path::append(path, LLDB_PYTHON_RELATIVE_LIBDIR); + +#if defined(_WIN32) + // This will be injected directly through FileSpec.GetDirectory().SetString(), + // so we need to normalize manually. + std::replace(path.begin(), path.end(), '\\', '/'); +#endif } FileSpec ScriptInterpreterPython::GetPythonDir() { @@ -334,7 +340,6 @@ FileSpec ScriptInterpreterPython::GetPyt #else ComputePythonDir(path); #endif -llvm::sys::path::native(path); spec.GetDirectory().SetString(path); return spec; }(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r374250 - [lldb] Put site-packages into a sub dir of CMAKE_CFG_INTDIR
Author: hhb Date: Wed Oct 9 15:34:55 2019 New Revision: 374250 URL: http://llvm.org/viewvc/llvm-project?rev=374250&view=rev Log: [lldb] Put site-packages into a sub dir of CMAKE_CFG_INTDIR Summary: Fixes issue like D68719 Reviewers: tatyana-krasnukha Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68728 Modified: lldb/trunk/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=374250&r1=374249&r2=374250&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Wed Oct 9 15:34:55 2019 @@ -202,8 +202,9 @@ if (NOT LLDB_DISABLE_PYTHON) if(LLDB_BUILD_FRAMEWORK) set(lldb_python_build_path "${liblldb_build_dir}/LLDB.framework/Resources/Python/lldb") else() - set(lldb_python_build_path "${CMAKE_BINARY_DIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") + set(lldb_python_build_path "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") endif() +get_filename_component(lldb_python_build_path ${lldb_python_build_path} ABSOLUTE) # Add a Post-Build Event to copy over Python files and create the symlink # to liblldb.so for the Python API(hardlink on Windows). ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r374483 - Clean up format in cmake file
Author: hhb Date: Thu Oct 10 17:12:20 2019 New Revision: 374483 URL: http://llvm.org/viewvc/llvm-project?rev=374483&view=rev Log: Clean up format in cmake file Summary: Makes the indent consistent to other part of the file. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68842 Modified: lldb/trunk/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=374483&r1=374482&r2=374483&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Thu Oct 10 17:12:20 2019 @@ -190,73 +190,73 @@ if(LLDB_INCLUDE_TESTS) endif() if (NOT LLDB_DISABLE_PYTHON) -if(NOT LLDB_BUILD_FRAMEWORK) - set(use_python_wrapper_from_src_dir -m) -endif() -if(LLDB_USE_SYSTEM_SIX) - set(use_six_py_from_system --useSystemSix) -endif() -get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR) -get_target_property(liblldb_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) - -if(LLDB_BUILD_FRAMEWORK) - set(lldb_python_build_path "${liblldb_build_dir}/LLDB.framework/Resources/Python/lldb") -else() - set(lldb_python_build_path "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") -endif() -get_filename_component(lldb_python_build_path ${lldb_python_build_path} ABSOLUTE) - -# Add a Post-Build Event to copy over Python files and create the symlink -# to liblldb.so for the Python API(hardlink on Windows). -add_custom_target(finish_swig ALL -COMMAND - ${PYTHON_EXECUTABLE} ${LLDB_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py - --srcRoot=${LLDB_SOURCE_DIR} - --targetDir=${liblldb_build_dir} - --cfgBldDir=${lldb_scripts_dir} - --prefix=${CMAKE_BINARY_DIR} - --cmakeBuildConfiguration=${CMAKE_CFG_INTDIR} - --lldbLibDir=lib${LLVM_LIBDIR_SUFFIX} - --lldbPythonPath=${lldb_python_build_path} - ${use_python_wrapper_from_src_dir} - ${use_six_py_from_system} -VERBATIM -DEPENDS ${LLDB_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py -DEPENDS ${lldb_scripts_dir}/lldb.py -COMMENT "Python script sym-linking LLDB Python API") - -add_dependencies(finish_swig swig_wrapper liblldb lldb-argdumper) -set_target_properties(finish_swig swig_wrapper PROPERTIES FOLDER "lldb misc") - -# Ensure we do the python post-build step when building lldb. -add_dependencies(lldb finish_swig) - -if(NOT LLDB_BUILD_FRAMEWORK) - # Install the LLDB python module - add_custom_target(lldb-python-scripts) - add_dependencies(lldb-python-scripts finish_swig) - install(DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_PYTHON_RELATIVE_PATH}/ - DESTINATION ${LLDB_PYTHON_RELATIVE_PATH} - COMPONENT lldb-python-scripts) - if (NOT LLVM_ENABLE_IDE) -add_llvm_install_targets(install-lldb-python-scripts - COMPONENT lldb-python-scripts - DEPENDS lldb-python-scripts) - endif() + if(NOT LLDB_BUILD_FRAMEWORK) +set(use_python_wrapper_from_src_dir -m) + endif() + if(LLDB_USE_SYSTEM_SIX) +set(use_six_py_from_system --useSystemSix) + endif() + get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR) + get_target_property(liblldb_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) + + if(LLDB_BUILD_FRAMEWORK) +set(lldb_python_build_path "${liblldb_build_dir}/LLDB.framework/Resources/Python/lldb") + else() +set(lldb_python_build_path "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") + endif() + get_filename_component(lldb_python_build_path ${lldb_python_build_path} ABSOLUTE) + + # Add a Post-Build Event to copy over Python files and create the symlink + # to liblldb.so for the Python API(hardlink on Windows). + add_custom_target(finish_swig ALL +COMMAND + ${PYTHON_EXECUTABLE} ${LLDB_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py +--srcRoot=${LLDB_SOURCE_DIR} +--targetDir=${liblldb_build_dir} +--cfgBldDir=${lldb_scripts_dir} +--prefix=${CMAKE_BINARY_DIR} +--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR} +--lldbLibDir=lib${LLVM_LIBDIR_SUFFIX} +--lldbPythonPath=${lldb_python_build_path} +${use_python_wrapper_from_src_dir} +${use_six_py_from_system} +VERBATIM +DEPENDS ${LLDB_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py +DEPENDS ${lldb_scripts_dir}/lldb.py +COMMENT "Python script sym-linking LLDB Python API") + + add_dependencies(finish_swig swig_wrapper liblldb lldb-argdumper) + set_target_properties(finish_swig swig_wrapper PROPERTIES FOLDER "lldb misc") + + # Ensure we do the python post-build step when building lldb. + add_dependencies(
[Lldb-commits] [lldb] r374577 - [lldb] Fix python packages install path
Author: hhb Date: Fri Oct 11 10:44:14 2019 New Revision: 374577 URL: http://llvm.org/viewvc/llvm-project?rev=374577&view=rev Log: [lldb] Fix python packages install path Reviewers: mgorny Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68878 Modified: lldb/trunk/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=374577&r1=374576&r2=374577&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Fri Oct 11 10:44:14 2019 @@ -235,7 +235,7 @@ if (NOT LLDB_DISABLE_PYTHON) # Install the LLDB python module add_custom_target(lldb-python-scripts) add_dependencies(lldb-python-scripts finish_swig) -install(DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_PYTHON_RELATIVE_PATH}/ +install(DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/ DESTINATION ${LLDB_PYTHON_RELATIVE_PATH} COMPONENT lldb-python-scripts) if (NOT LLVM_ENABLE_IDE) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r374953 - [lldb] Creates _liblldb symlink from cmake
Author: hhb Date: Tue Oct 15 14:58:45 2019 New Revision: 374953 URL: http://llvm.org/viewvc/llvm-project?rev=374953&view=rev Log: [lldb] Creates _liblldb symlink from cmake Summary: This is another attempt of D67993. This change removed hard coded relative paths. This way we can generate correct result when get_python_lib() returns a different path, or LLDB_PYTHON_RELATIVE_PATH is specified directly. By moving things out of python, we are also able to correctly process more cross compile situations. E.g. .pyd vs .so for Windows. Subscribers: lldb-commits, mgorny Tags: #lldb Differential Revision: https://reviews.llvm.org/D68858 Modified: lldb/trunk/CMakeLists.txt lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=374953&r1=374952&r2=374953&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Tue Oct 15 14:58:45 2019 @@ -204,7 +204,6 @@ if (NOT LLDB_DISABLE_PYTHON) else() set(lldb_python_build_path "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") endif() - get_filename_component(lldb_python_build_path ${lldb_python_build_path} ABSOLUTE) # Add a Post-Build Event to copy over Python files and create the symlink # to liblldb.so for the Python API(hardlink on Windows). @@ -225,6 +224,43 @@ if (NOT LLDB_DISABLE_PYTHON) DEPENDS ${lldb_scripts_dir}/lldb.py COMMENT "Python script sym-linking LLDB Python API") + function(create_relative_symlink target dest_file output_dir output_name) +get_filename_component(dest_file ${dest_file} ABSOLUTE) +get_filename_component(output_dir ${output_dir} ABSOLUTE) +file(RELATIVE_PATH rel_dest_file ${output_dir} ${dest_file}) +if(CMAKE_HOST_UNIX) + set(LLVM_LINK_OR_COPY create_symlink) +else() + set(LLVM_LINK_OR_COPY copy) +endif() +add_custom_command(TARGET ${target} POST_BUILD VERBATIM + COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} ${rel_dest_file} ${output_name} + WORKING_DIRECTORY ${output_dir}) + endfunction() + + if(LLDB_BUILD_FRAMEWORK) +set(LIBLLDB_SYMLINK_DEST "${liblldb_build_dir}/LLDB.framework/LLDB") + else() +set(LIBLLDB_SYMLINK_DEST "${LLVM_SHLIB_OUTPUT_INTDIR}/liblldb${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() + if(WIN32) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(LIBLLDB_SYMLINK_OUTPUT_FILE "_lldb_d.pyd") +else() + set(LIBLLDB_SYMLINK_OUTPUT_FILE "_lldb.pyd") +endif() + else() +set(LIBLLDB_SYMLINK_OUTPUT_FILE "_lldb.so") + endif() + create_relative_symlink(finish_swig ${LIBLLDB_SYMLINK_DEST} + ${lldb_python_build_path} ${LIBLLDB_SYMLINK_OUTPUT_FILE}) + + if(NOT LLDB_BUILD_FRAMEWORK) +set(LLDB_ARGDUMPER_FILENAME "lldb-argdumper${CMAKE_EXECUTABLE_SUFFIX}") +create_relative_symlink(finish_swig "${LLVM_RUNTIME_OUTPUT_INTDIR}/${LLDB_ARGDUMPER_FILENAME}" +${lldb_python_build_path} ${LLDB_ARGDUMPER_FILENAME}) + endif() + add_dependencies(finish_swig swig_wrapper liblldb lldb-argdumper) set_target_properties(finish_swig swig_wrapper PROPERTIES FOLDER "lldb misc") Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=374953&r1=374952&r2=374953&view=diff == --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original) +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Tue Oct 15 14:58:45 2019 @@ -245,284 +245,6 @@ def copy_lldbpy_file_to_lldb_pkg_dir( return (bOk, strMsg) -#++--- -# Details: Make the symbolic link on a Windows platform. -# Args: vstrSrcFile - (R) Source file name. -# vstrTargetFile - (R) Destination file name. -# Returns: Bool - True = function success, False = failure. -# Str - Error description on task failure. -# Throws: None. -#-- - - -def make_symlink_windows(vstrSrcPath, vstrTargetPath): -print(("Making symlink from %s to %s" % (vstrSrcPath, vstrTargetPath))) -dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_windows()") -bOk = True -strErrMsg = "" -# If the src file doesn't exist, this is an error and we should throw. -src_stat = os.stat(vstrSrcPath) - -try: -target_stat = os.stat(vstrTargetPath) -# If the target file exists but refers to a different file, delete it so that we can -# re-create the link. This can happen if you run this script once (creating a link) -# and then delete the source file (so that a brand new file gets created the next time -# you compile and link), and then re-run this script, s
[Lldb-commits] [lldb] r375024 - [lldb] move more things from python to cmake
Author: hhb Date: Wed Oct 16 11:00:21 2019 New Revision: 375024 URL: http://llvm.org/viewvc/llvm-project?rev=375024&view=rev Log: [lldb] move more things from python to cmake Summary: Move the copy of six.py, lldb.py and macosx/heap Reviewers: labath Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69016 Modified: lldb/trunk/CMakeLists.txt lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=375024&r1=375023&r2=375024&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Wed Oct 16 11:00:21 2019 @@ -208,6 +208,7 @@ if (NOT LLDB_DISABLE_PYTHON) # Add a Post-Build Event to copy over Python files and create the symlink # to liblldb.so for the Python API(hardlink on Windows). add_custom_target(finish_swig ALL +COMMAND ${CMAKE_COMMAND} -E make_directory ${lldb_python_build_path} COMMAND ${PYTHON_EXECUTABLE} ${LLDB_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py --srcRoot=${LLDB_SOURCE_DIR} @@ -224,6 +225,28 @@ if (NOT LLDB_DISABLE_PYTHON) DEPENDS ${lldb_scripts_dir}/lldb.py COMMENT "Python script sym-linking LLDB Python API") + if(NOT LLDB_USE_SYSTEM_SIX) +add_custom_command(TARGET finish_swig POST_BUILD VERBATIM + COMMAND ${CMAKE_COMMAND} -E copy +"${LLDB_SOURCE_DIR}/third_party/Python/module/six/six.py" +"${lldb_python_build_path}/../six.py") + endif() + + add_custom_command(TARGET finish_swig POST_BUILD VERBATIM +COMMAND ${CMAKE_COMMAND} -E copy + "${lldb_scripts_dir}/lldb.py" + "${lldb_python_build_path}/__init__.py") + + if(APPLE) +SET(lldb_python_heap_dir "${lldb_python_build_path}/macosx/heap") +add_custom_command(TARGET finish_swig POST_BUILD VERBATIM + COMMAND ${CMAKE_COMMAND} -E make_directory ${lldb_python_heap_dir} + COMMAND ${CMAKE_COMMAND} -E copy +"${LLDB_SOURCE_DIR}/examples/darwin/heap_find/heap/heap_find.cpp" +"${LLDB_SOURCE_DIR}/examples/darwin/heap_find/heap/Makefile" +${lldb_python_heap_dir}) + endif() + function(create_relative_symlink target dest_file output_dir output_name) get_filename_component(dest_file ${dest_file} ABSOLUTE) get_filename_component(output_dir ${output_dir} ABSOLUTE) Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=375024&r1=375023&r2=375024&view=diff == --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original) +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Wed Oct 16 11:00:21 2019 @@ -74,56 +74,6 @@ strMsgCopySixPy = "Copying six.py from ' strErrMsgCopySixPyFailed = "Unable to copy '%s' to '%s'" -def is_debug_interpreter(): -return hasattr(sys, 'gettotalrefcount') - -#++--- -# Details: Copy files needed by lldb/macosx/heap.py to build libheap.dylib. -# Args: vDictArgs - (R) Program input parameters. -# vstrFrameworkPythonDir - (R) Python framework directory. -# Returns: Bool - True = function success, False = failure. -# Str - Error description on task failure. -# Throws: None. -#-- - - -def macosx_copy_file_for_heap(vDictArgs, vstrFrameworkPythonDir): -dbg = utilsDebug.CDebugFnVerbose( -"Python script macosx_copy_file_for_heap()") -bOk = True -strMsg = "" - -eOSType = utilsOsType.determine_os_type() -if eOSType != utilsOsType.EnumOsType.Darwin: -return (bOk, strMsg) - -strHeapDir = os.path.join(vstrFrameworkPythonDir, "macosx", "heap") -strHeapDir = os.path.normcase(strHeapDir) -if os.path.exists(strHeapDir) and os.path.isdir(strHeapDir): -return (bOk, strMsg) - -os.makedirs(strHeapDir) - -strRoot = os.path.normpath(vDictArgs["--srcRoot"]) -strSrc = os.path.join( -strRoot, -"examples", -"darwin", -"heap_find", -"heap", -"heap_find.cpp") -shutil.copy(strSrc, strHeapDir) -strSrc = os.path.join( -strRoot, -"examples", -"darwin", -"heap_find", -"heap", -"Makefile") -shutil.copy(strSrc, strHeapDir) - -return (bOk, strMsg) - #++--- # Details: Create Python packages and Python __init__ files. # Args: vDictArgs - (R) Program input parameters. @@ -198,142 +148,6 @@ def create_py_pkg( return (bOk, strMsg) -#++--- -# Details: Copy the lldb.py file into the lldb package directory and rename -#
[Lldb-commits] [lldb] 6a79e08 - [lldb] Add a install target for lldb python on darwin
Author: Haibo Huang Date: 2019-11-05T13:25:38-08:00 New Revision: 6a79e083a0d131e741ac8f48badbb0481491e47f URL: https://github.com/llvm/llvm-project/commit/6a79e083a0d131e741ac8f48badbb0481491e47f DIFF: https://github.com/llvm/llvm-project/commit/6a79e083a0d131e741ac8f48badbb0481491e47f.diff LOG: [lldb] Add a install target for lldb python on darwin Summary: Similar to D68370 but for darwin framework build. Reviewers: aadsm Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69834 Added: Modified: lldb/CMakeLists.txt Removed: diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 388bcf76e662..128130621ba0 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -216,18 +216,21 @@ if (NOT LLDB_DISABLE_PYTHON) # Ensure we do the python post-build step when building lldb. add_dependencies(lldb finish_swig) - if(NOT LLDB_BUILD_FRAMEWORK) -# Install the LLDB python module -add_custom_target(lldb-python-scripts) -add_dependencies(lldb-python-scripts finish_swig) -install(DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/ -DESTINATION ${LLDB_PYTHON_RELATIVE_PATH} -COMPONENT lldb-python-scripts) -if (NOT LLVM_ENABLE_IDE) - add_llvm_install_targets(install-lldb-python-scripts - COMPONENT lldb-python-scripts - DEPENDS lldb-python-scripts) -endif() + # Install the LLDB python module + if(LLDB_BUILD_FRAMEWORK) +set(LLDB_PYTHON_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Resources/Python) + else() +set(LLDB_PYTHON_INSTALL_PATH ${LLDB_PYTHON_RELATIVE_PATH}) + endif() + add_custom_target(lldb-python-scripts) + add_dependencies(lldb-python-scripts finish_swig) + install(DIRECTORY ${lldb_python_build_path}/../ + DESTINATION ${LLDB_PYTHON_INSTALL_PATH} + COMPONENT lldb-python-scripts) + if (NOT LLVM_ENABLE_IDE) +add_llvm_install_targets(install-lldb-python-scripts + COMPONENT lldb-python-scripts + DEPENDS lldb-python-scripts) endif() # Add a Post-Build Event to copy the custom Python DLL to the lldb binaries dir so that Windows can find it when launching ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 77a60f0 - [lldb] Record framework build path and use it everywhere
Author: Haibo Huang Date: 2019-11-06T14:05:35-08:00 New Revision: 77a60f0df673074a2c9276498f95a9eaadeece56 URL: https://github.com/llvm/llvm-project/commit/77a60f0df673074a2c9276498f95a9eaadeece56 DIFF: https://github.com/llvm/llvm-project/commit/77a60f0df673074a2c9276498f95a9eaadeece56.diff LOG: [lldb] Record framework build path and use it everywhere This avoids config time dependencies on liblldb. And enables other refactoring. Added: Modified: lldb/CMakeLists.txt lldb/cmake/modules/AddLLDB.cmake lldb/cmake/modules/LLDBConfig.cmake lldb/cmake/modules/LLDBFramework.cmake lldb/test/API/CMakeLists.txt lldb/tools/debugserver/source/CMakeLists.txt lldb/tools/driver/CMakeLists.txt lldb/tools/lldb-vscode/CMakeLists.txt Removed: diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 128130621ba0..81d7dd8123bd 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -93,10 +93,9 @@ endif() if (NOT LLDB_DISABLE_PYTHON) get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR) - get_target_property(liblldb_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) if(LLDB_BUILD_FRAMEWORK) -set(lldb_python_build_path "${liblldb_build_dir}/LLDB.framework/Resources/Python/lldb") +set(lldb_python_build_path "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb") else() set(lldb_python_build_path "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") endif() @@ -188,7 +187,7 @@ if (NOT LLDB_DISABLE_PYTHON) endfunction() if(LLDB_BUILD_FRAMEWORK) -set(LIBLLDB_SYMLINK_DEST "${liblldb_build_dir}/LLDB.framework/LLDB") +set(LIBLLDB_SYMLINK_DEST "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/LLDB") else() set(LIBLLDB_SYMLINK_DEST "${LLVM_SHLIB_OUTPUT_INTDIR}/liblldb${CMAKE_SHARED_LIBRARY_SUFFIX}") endif() diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake index b58a62ca7771..6f05be384908 100644 --- a/lldb/cmake/modules/AddLLDB.cmake +++ b/lldb/cmake/modules/AddLLDB.cmake @@ -227,8 +227,7 @@ endfunction() function(lldb_add_to_buildtree_lldb_framework name subdir) # Destination for the copy in the build-tree. While the framework target may # not exist yet, it will exist when the generator expression gets expanded. - get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) - set(copy_dest "${framework_build_dir}/${subdir}/$") + set(copy_dest "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/${subdir}/$") # Copy into the given subdirectory for testing. add_custom_command(TARGET ${name} POST_BUILD diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index c042cbf1b22e..e9ed2229d6bf 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -68,6 +68,9 @@ if(LLDB_BUILD_FRAMEWORK) set(LLDB_FRAMEWORK_BUILD_DIR bin CACHE STRING "Output directory for LLDB.framework") set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Install directory for LLDB.framework") + get_filename_component(LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE +BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}) + # Essentially, emit the framework's dSYM outside of the framework directory. set(LLDB_DEBUGINFO_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin CACHE STRING "Directory to emit dSYM files stripped from executables and libraries (Darwin Only)") diff --git a/lldb/cmake/modules/LLDBFramework.cmake b/lldb/cmake/modules/LLDBFramework.cmake index 249fea30a874..b6488936806a 100644 --- a/lldb/cmake/modules/LLDBFramework.cmake +++ b/lldb/cmake/modules/LLDBFramework.cmake @@ -1,10 +1,4 @@ -# Path relative to the root binary directory -get_filename_component( - framework_target_dir ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE - BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR} -) - -message(STATUS "LLDB.framework: build path is '${framework_target_dir}'") +message(STATUS "LLDB.framework: build path is '${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}'") message(STATUS "LLDB.framework: install path is '${LLDB_FRAMEWORK_INSTALL_DIR}'") message(STATUS "LLDB.framework: resources subdirectory is 'Versions/${LLDB_FRAMEWORK_VERSION}/Resources'") @@ -15,7 +9,7 @@ set_target_properties(liblldb PROPERTIES OUTPUT_NAME LLDB VERSION ${LLDB_VERSION} - LIBRARY_OUTPUT_DIRECTORY ${framework_target_dir} + LIBRARY_OUTPUT_DIRECTORY ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR} # Compatibility version SOVERSION "1.0.0" @@ -29,8 +23,8 @@ set_target_properties(liblldb PROPERTIES # Used in llvm_add_library() to set default output directories for multi-config # generators. Overwrite to account for special framework output directory. set_output_directory(liblldb - BINARY_DIR ${framework_target_dir} - LIBRARY_DIR ${framework_target_dir} + BINARY
[Lldb-commits] [lldb] 780d7d7 - [lldb] Allows customizing libxml2 for darwin
Author: Haibo Huang Date: 2020-05-20T12:27:08-07:00 New Revision: 780d7d77327c3537cc2c2aa9314aa2ad92cfe070 URL: https://github.com/llvm/llvm-project/commit/780d7d77327c3537cc2c2aa9314aa2ad92cfe070 DIFF: https://github.com/llvm/llvm-project/commit/780d7d77327c3537cc2c2aa9314aa2ad92cfe070.diff LOG: [lldb] Allows customizing libxml2 for darwin Summary: This changes allows to disable or use customized libxml2 for lldb. 1. Removes redundant include_directories. The one in LLDBConfig.cmake should be enough. 2. Link to ${LIBXML2_LIBRARIES} if xml2 is enabled. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D80257 Added: Modified: lldb/cmake/modules/LLDBConfig.cmake lldb/source/Host/CMakeLists.txt lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt Removed: diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index 6b10f73eff19..c63e5316ccfc 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -286,7 +286,6 @@ if (APPLE) ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY} ${DEBUG_SYMBOLS_LIBRARY}) - include_directories(${LIBXML2_INCLUDE_DIR}) endif() if( WIN32 AND NOT CYGWIN ) diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt index a5e4e352d036..add503a5f36a 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt @@ -83,7 +83,6 @@ else() ) if (CMAKE_SYSTEM_NAME MATCHES "Darwin") -include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR}) add_subdirectory(macosx/objcxx) set(LLDBObjCLibs lldbHostMacOSXObjCXX) add_host_subdirectory(macosx @@ -137,14 +136,10 @@ endif() set(EXTRA_LIBS) if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") list(APPEND EXTRA_LIBS kvm) -endif () -if (APPLE) - list(APPEND EXTRA_LIBS xml2) -else () - if (LIBXML2_FOUND) -list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) - endif() -endif () +endif() +if (LLDB_ENABLE_LIBXML2) + list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) +endif() if (HAVE_LIBDL) list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) endif() @@ -156,7 +151,7 @@ if (LLDB_ENABLE_LZMA) endif() if (WIN32) list(APPEND LLDB_SYSTEM_LIBS psapi) -endif () +endif() if (LLDB_ENABLE_LIBEDIT) list(APPEND LLDB_LIBEDIT_LIBS ${LibEdit_LIBRARIES}) diff --git a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt index d5a84d87fcd9..447079712056 100644 --- a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt +++ b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt @@ -25,7 +25,6 @@ list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES ) if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - include_directories(${LIBXML2_INCLUDE_DIR}) add_subdirectory(objcxx) set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCXX") list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES diff --git a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt index 477f224b940d..448d032b381f 100644 --- a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt +++ b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt @@ -6,10 +6,6 @@ lldb_tablegen(ProcessGDBRemotePropertiesEnum.inc -gen-lldb-property-enum-defs SOURCE ProcessGDBRemoteProperties.td TARGET LLDBPluginProcessGDBRemotePropertiesEnumGen) -if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - include_directories(${LIBXML2_INCLUDE_DIR}) -endif() - set(LLDB_PLUGINS lldbPluginProcessUtility lldbPluginPlatformMacOSX diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt b/lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt index 8e82eae1513d..2cf185131238 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories(${LIBXML2_INCLUDE_DIR}) - add_lldb_library(lldbPluginSymbolVendorMacOSX PLUGIN SymbolVendorMacOSX.cpp ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 04daba9 - [lldb] Cleans up system_libs
Author: Haibo Huang Date: 2020-05-20T12:30:08-07:00 New Revision: 04daba967031b7e3a72935613f23cb0051b56fc8 URL: https://github.com/llvm/llvm-project/commit/04daba967031b7e3a72935613f23cb0051b56fc8 DIFF: https://github.com/llvm/llvm-project/commit/04daba967031b7e3a72935613f23cb0051b56fc8.diff LOG: [lldb] Cleans up system_libs Summary: Long long ago system_libs was appended to LLDB_SYSTEM_LIBS in cmake/LLDBDependencies.cmake. After that file was removed, system_libs is orphaned. Currently the only user is source/Utility. Move the logic there and remove system_libs. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D80253 Added: Modified: lldb/cmake/modules/LLDBConfig.cmake lldb/source/Utility/CMakeLists.txt Removed: diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index c63e5316ccfc..8465cfe3b7b7 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -234,7 +234,6 @@ if (LLDB_ENABLE_LZMA) endif() if (LLDB_ENABLE_LIBXML2) - list(APPEND system_libs ${LIBXML2_LIBRARIES}) include_directories(${LIBXML2_INCLUDE_DIR}) endif() @@ -280,12 +279,7 @@ if (APPLE) find_library(FOUNDATION_LIBRARY Foundation) find_library(CORE_FOUNDATION_LIBRARY CoreFoundation) find_library(SECURITY_LIBRARY Security) - list(APPEND system_libs - ${FOUNDATION_LIBRARY} - ${CORE_FOUNDATION_LIBRARY} - ${CORE_SERVICES_LIBRARY} - ${SECURITY_LIBRARY} - ${DEBUG_SYMBOLS_LIBRARY}) + include_directories(${LIBXML2_INCLUDE_DIR}) endif() if( WIN32 AND NOT CYGWIN ) @@ -295,11 +289,8 @@ endif() if(NOT PURE_WINDOWS) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads REQUIRED) - list(APPEND system_libs ${CMAKE_THREAD_LIBS_INIT}) endif() -list(APPEND system_libs ${CMAKE_DL_LIBS}) - # Figure out if lldb could use lldb-server. If so, then we'll # ensure we build lldb-server when an lldb target is being built. if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD|Windows") diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt index 48456ef1e3b1..c89d4f9e0072 100644 --- a/lldb/source/Utility/CMakeLists.txt +++ b/lldb/source/Utility/CMakeLists.txt @@ -1,6 +1,19 @@ set(LLDB_SYSTEM_LIBS) -list(APPEND LLDB_SYSTEM_LIBS ${system_libs}) +if (APPLE) + list(APPEND LLDB_SYSTEM_LIBS + ${FOUNDATION_LIBRARY} + ${CORE_FOUNDATION_LIBRARY} + ${CORE_SERVICES_LIBRARY} + ${SECURITY_LIBRARY} + ${DEBUG_SYMBOLS_LIBRARY}) +endif() + +if(NOT PURE_WINDOWS) + list(APPEND LLDB_SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT}) +endif() + +list(APPEND LLDB_SYSTEM_LIBS ${CMAKE_DL_LIBS}) if (CMAKE_SYSTEM_NAME MATCHES "Windows") list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits