diff options
| author | Stefan Granitz <stefan.graenitz@gmail.com> | 2019-01-04 12:46:34 +0000 | 
|---|---|---|
| committer | Stefan Granitz <stefan.graenitz@gmail.com> | 2019-01-04 12:46:34 +0000 | 
| commit | fd6fedfbe09cb66ec7498dd0330ea1bfd3d9d49d (patch) | |
| tree | 29f95c84c5dcb4a9483dd1da69df295df8309e17 | |
| parent | 90aeb4c8d9835d31c4247bb92ca63ed153907d50 (diff) | |
| download | bcm5719-llvm-fd6fedfbe09cb66ec7498dd0330ea1bfd3d9d49d.tar.gz bcm5719-llvm-fd6fedfbe09cb66ec7498dd0330ea1bfd3d9d49d.zip | |
[CMake] Aggregate options for LLDB in LLDBConfig.cmake
Summary: In preparation for LLDB.framework changes, collect options for LLDB in LLDBConfig.cmake (used for both, standalone and in-tree builds of LLDB).
Reviewers: JDevlieghere, aprantl, xiaobai
Reviewed By: aprantl
Subscribers: srhines, mgorny, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D55317
llvm-svn: 350389
| -rw-r--r-- | lldb/CMakeLists.txt | 18 | ||||
| -rw-r--r-- | lldb/cmake/modules/LLDBConfig.cmake | 54 | 
2 files changed, 34 insertions, 38 deletions
| diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index e0af678cbfb..e98d7e02ad1 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -18,15 +18,6 @@ else()    add_definitions( -DLLDB_CONFIGURATION_RELEASE )  endif() -if (CMAKE_SYSTEM_NAME MATCHES "Windows|Android") -  set(LLDB_DEFAULT_DISABLE_LIBEDIT 1) -else() -  set(LLDB_DEFAULT_DISABLE_LIBEDIT 0) -endif () - -# We need libedit support to go down both the source and -# the scripts directories. -set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.")  if (LLDB_DISABLE_LIBEDIT)    add_definitions( -DLLDB_DISABLE_LIBEDIT )  else() @@ -42,16 +33,9 @@ endif()  add_custom_target(lldb-suite)  set(LLDB_SUITE_TARGET lldb-suite) -option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off)  if(LLDB_BUILD_FRAMEWORK) -  if (CMAKE_VERSION VERSION_LESS 3.7) -    message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7") -  endif() -  if (NOT APPLE) -    message(FATAL_ERROR "LLDB.framework can only be generated when targeting Apple platforms") -  endif() -    add_custom_target(lldb-framework) +    # These are used to fill out LLDB-Info.plist. These are relevant when building    # the framework, and must be defined before building liblldb.    set(PRODUCT_NAME "LLDB") diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index fc3913943e7..9cd286f9b27 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -10,28 +10,42 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darw    set(LLDB_LINKER_SUPPORTS_GROUPS ON)  endif() -set(LLDB_DEFAULT_DISABLE_PYTHON 0) -set(LLDB_DEFAULT_DISABLE_CURSES 0) - -if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) -  set(LLDB_DEFAULT_DISABLE_CURSES 1) -elseif (CMAKE_SYSTEM_NAME MATCHES "Android" ) -  set(LLDB_DEFAULT_DISABLE_PYTHON 1) -  set(LLDB_DEFAULT_DISABLE_CURSES 1) -elseif(IOS) -  set(LLDB_DEFAULT_DISABLE_PYTHON 1) -endif() +set(default_disable_python OFF) +set(default_disable_curses OFF) +set(default_disable_libedit OFF) -set(LLDB_DISABLE_PYTHON ${LLDB_DEFAULT_DISABLE_PYTHON} CACHE BOOL -  "Disables the Python scripting integration.") -set(LLDB_DISABLE_CURSES ${LLDB_DEFAULT_DISABLE_CURSES} CACHE BOOL -  "Disables the Curses integration.") +if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT) +  set(default_disable_libedit ON) +endif() -set(LLDB_RELOCATABLE_PYTHON 0 CACHE BOOL -  "Causes LLDB to use the PYTHONHOME environment variable to locate Python.") +if(CMAKE_SYSTEM_NAME MATCHES "Windows") +  set(default_disable_curses ON) +  set(default_disable_libedit ON) +elseif(CMAKE_SYSTEM_NAME MATCHES "Android") +  set(default_disable_python ON) +  set(default_disable_curses ON) +  set(default_disable_libedit ON) +elseif(IOS) +  set(default_disable_python ON) +endif() -set(LLDB_USE_SYSTEM_SIX 0 CACHE BOOL -  "Use six.py shipped with system and do not install a copy of it") +option(LLDB_DISABLE_PYTHON "Disable Python scripting integration." ${default_disable_python}) +option(LLDB_DISABLE_CURSES "Disable Curses integration." ${default_disable_curses}) +option(LLDB_DISABLE_LIBEDIT "Disable the use of editline." ${default_disable_libedit}) +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) + +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 +  if(CMAKE_VERSION VERSION_LESS 3.7) +    message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7") +  endif() +endif()  if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")    set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL @@ -50,8 +64,6 @@ if (LLDB_DISABLE_CURSES)    add_definitions( -DLLDB_DISABLE_CURSES )  endif() -option(LLDB_USE_ENTITLEMENTS "When code signing, use entitlements if available" ON) -  # On Windows, we can't use the normal FindPythonLibs module that comes with CMake,  # for a number of reasons.  # 1) Prior to MSVC 2015, it is only possible to embed Python if python itself was | 

