sgraenitz created this revision.
sgraenitz added reviewers: JDevlieghere, aprantl, xiaobai.
Herald added subscribers: mgorny, srhines.
In preparation for LLDB.framework changes, collect options for LLDB in
LLDBConfig.cmake (used for both, standalone and in-tree builds).
https://reviews.llvm.org/D55317
Files:
CMakeLists.txt
cmake/modules/LLDBConfig.cmake
Index: cmake/modules/LLDBConfig.cmake
===================================================================
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -10,28 +10,42 @@
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_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF)
+option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON)
+
+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
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -18,15 +18,6 @@
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 @@
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")
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits