1 cmake_minimum_required(VERSION 2.8)
3 include(cmake/modules/LLDBStandalone.cmake)
4 include(cmake/modules/LLDBConfig.cmake)
5 include(cmake/modules/AddLLDB.cmake)
7 if (__ANDROID_NDK__ OR (CMAKE_SYSTEM_NAME MATCHES "Windows"))
8 set(LLDB_DEFAULT_DISABLE_LIBEDIT 1)
10 set(LLDB_DEFAULT_DISABLE_LIBEDIT 0)
13 # We need libedit support to go down both the source and
14 # the scripts directories.
15 set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.")
16 if (LLDB_DISABLE_LIBEDIT)
17 add_definitions( -DLLDB_DISABLE_LIBEDIT )
20 # add_subdirectory(include)
21 add_subdirectory(docs)
22 if (NOT LLDB_DISABLE_PYTHON)
23 add_subdirectory(scripts)
25 add_subdirectory(source)
26 add_subdirectory(test)
27 add_subdirectory(tools)
28 add_subdirectory(unittests)
31 if (NOT LLDB_DISABLE_PYTHON)
32 # Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows)
33 add_custom_target( finish_swig ALL
34 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}/scripts" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/scripts" "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" -m
35 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py
36 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/scripts/lldb.py
37 COMMENT "Python script sym-linking LLDB Python API")
38 # We depend on liblldb being built before we can do this step.
39 add_dependencies(finish_swig liblldb lldb-argdumper)
41 # If we build the readline module, we depend on that happening
44 add_dependencies(finish_swig readline)
47 # Ensure we do the python post-build step when building lldb.
48 add_dependencies(lldb finish_swig)
50 # Add a Post-Build Event to copy the custom Python DLL to the lldb binaries dir so that Windows can find it when launching
51 # lldb.exe or any other executables that were linked with liblldb.
52 if (WIN32 AND NOT "${PYTHON_DLL}" STREQUAL "")
53 # When using the Visual Studio CMake generator the lldb binaries end up in Release/bin, Debug/bin etc.
54 file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin" LLDB_BIN_DIR)
55 file(TO_NATIVE_PATH "${PYTHON_DLL}" PYTHON_DLL_NATIVE_PATH)
59 COMMAND "${CMAKE_COMMAND}" -E copy ${PYTHON_DLL_NATIVE_PATH} ${LLDB_BIN_DIR}
60 COMMENT "Copying Python DLL to LLDB binaries directory.")