summaryrefslogtreecommitdiff
path: root/cmake/modules
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/AddLLDB.cmake40
-rw-r--r--cmake/modules/LLDBConfig.cmake14
-rw-r--r--cmake/modules/LLDBGenerateConfig.cmake4
-rw-r--r--cmake/modules/LLDBStandalone.cmake4
4 files changed, 36 insertions, 26 deletions
diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake
index 4c6f1efd673da..2fd8b384d9e36 100644
--- a/cmake/modules/AddLLDB.cmake
+++ b/cmake/modules/AddLLDB.cmake
@@ -4,7 +4,7 @@ function(add_lldb_library name)
cmake_parse_arguments(PARAM
"MODULE;SHARED;STATIC;OBJECT;PLUGIN"
""
- "DEPENDS;LINK_LIBS;LINK_COMPONENTS"
+ "EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS"
${ARGN})
llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS})
list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS})
@@ -35,6 +35,8 @@ function(add_lldb_library name)
endif()
#PIC not needed on Win
+ # FIXME: Setting CMAKE_CXX_FLAGS here is a no-op, use target_compile_options
+ # or omit this logic instead.
if (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
@@ -64,11 +66,9 @@ function(add_lldb_library name)
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endif()
if (NOT CMAKE_CONFIGURATION_TYPES)
- add_custom_target(install-${name}
- DEPENDS ${name}
- COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=${name}
- -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+ add_llvm_install_targets(install-${name}
+ DEPENDS ${name}
+ COMPONENT ${name})
endif()
endif()
endif()
@@ -76,10 +76,10 @@ function(add_lldb_library name)
# Hack: only some LLDB libraries depend on the clang autogenerated headers,
# but it is simple enough to make all of LLDB depend on some of those
# headers without negatively impacting much of anything.
- get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY CLANG_TABLEGEN_TARGETS)
- if(CLANG_TABLEGEN_TARGETS)
- add_dependencies(${name} ${CLANG_TABLEGEN_TARGETS})
- endif()
+ add_dependencies(${name} clang-tablegen-targets)
+
+ # Add in any extra C++ compilation flags for this library.
+ target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS})
set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
endfunction(add_lldb_library)
@@ -95,17 +95,21 @@ function(add_lldb_executable name)
list(APPEND LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS})
add_llvm_executable(${name} ${ARG_UNPARSED_ARGUMENTS})
- target_link_libraries(${name} ${ARG_LINK_LIBS})
+ target_link_libraries(${name} PRIVATE ${ARG_LINK_LIBS})
set_target_properties(${name} PROPERTIES
FOLDER "lldb executables")
if(LLDB_BUILD_FRAMEWORK)
if(ARG_INCLUDE_IN_FRAMEWORK)
+ if(NOT IOS)
+ set(resource_dir "/Resources")
+ set(resource_dots "../")
+ endif()
string(REGEX REPLACE "[^/]+" ".." _dots ${LLDB_FRAMEWORK_INSTALL_DIR})
set_target_properties(${name} PROPERTIES
- RUNTIME_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:liblldb>/Resources
+ RUNTIME_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:liblldb>${resource_dir}
BUILD_WITH_INSTALL_RPATH On
- INSTALL_RPATH "@loader_path/../../../../${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}")
+ INSTALL_RPATH "@loader_path/../../../${resource_dots}${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}")
# For things inside the framework we don't need functional install targets
# because CMake copies the resources and headers from the build directory.
# But we still need this target to exist in order to use the
@@ -115,6 +119,8 @@ function(add_lldb_executable name)
if(ARG_GENERATE_INSTALL)
add_custom_target(install-${name} DEPENDS ${name})
add_dependencies(install-liblldb ${name})
+ add_custom_target(install-${name}-stripped DEPENDS ${name})
+ add_dependencies(install-liblldb-stripped ${name})
endif()
else()
set_target_properties(${name} PROPERTIES
@@ -128,11 +134,9 @@ function(add_lldb_executable name)
COMPONENT ${name}
RUNTIME DESTINATION bin)
if (NOT CMAKE_CONFIGURATION_TYPES)
- add_custom_target(install-${name}
- DEPENDS ${name}
- COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=${name}
- -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+ add_llvm_install_targets(install-${name}
+ DEPENDS ${name}
+ COMPONENT ${name})
endif()
endif()
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
index 726552675f474..8f75880dfbffd 100644
--- a/cmake/modules/LLDBConfig.cmake
+++ b/cmake/modules/LLDBConfig.cmake
@@ -22,10 +22,6 @@ elseif(IOS)
set(LLDB_DEFAULT_DISABLE_PYTHON 1)
endif()
-if(IOS)
- add_definitions(-DNO_XPC_SERVICES)
-endif()
-
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
@@ -235,6 +231,12 @@ if (CXX_SUPPORTS_NO_VLA_EXTENSION)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension")
endif ()
+check_cxx_compiler_flag("-Wno-gnu-anonymous-struct"
+ CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+
+check_cxx_compiler_flag("-Wno-nested-anon-types"
+ CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+
# Disable MSVC warnings
if( MSVC )
add_definitions(
@@ -282,6 +284,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
PATTERN ".svn" EXCLUDE
PATTERN ".cmake" EXCLUDE
PATTERN "Config.h" EXCLUDE
+ PATTERN "lldb-*.h" EXCLUDE
+ PATTERN "API/*.h" EXCLUDE
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
@@ -291,6 +295,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
PATTERN "*.h"
PATTERN ".svn" EXCLUDE
PATTERN ".cmake" EXCLUDE
+ PATTERN "lldb-*.h" EXCLUDE
+ PATTERN "API/*.h" EXCLUDE
)
endif()
diff --git a/cmake/modules/LLDBGenerateConfig.cmake b/cmake/modules/LLDBGenerateConfig.cmake
index d3d0cb220b934..ca2d5842a8060 100644
--- a/cmake/modules/LLDBGenerateConfig.cmake
+++ b/cmake/modules/LLDBGenerateConfig.cmake
@@ -3,11 +3,13 @@
include(CheckSymbolExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
+include(CheckLibraryExists)
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
check_symbol_exists(ppoll poll.h HAVE_PPOLL)
set(CMAKE_REQUIRED_DEFINITIONS)
check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
+check_cxx_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
check_include_file(termios.h HAVE_TERMIOS_H)
check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
@@ -21,6 +23,8 @@ check_cxx_source_compiles("
int main() { return __NR_process_vm_readv; }"
HAVE_NR_PROCESS_VM_READV)
+check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION)
+
# These checks exist in LLVM's configuration, so I want to match the LLVM names
# so that the check isn't duplicated, but we translate them into the LLDB names
# so that I don't have to change all the uses at the moment.
diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake
index 2f959c91fdd7b..f07a3fcb57b6c 100644
--- a/cmake/modules/LLDBStandalone.cmake
+++ b/cmake/modules/LLDBStandalone.cmake
@@ -3,10 +3,6 @@
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project(lldb)
- if (POLICY CMP0022)
- cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
- endif()
-
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
# Rely on llvm-config.