Commit Graph

264 Commits

Author SHA1 Message Date
Nico Weber d24faac011 Add Python 3.6 and 3.7 to the version list
Python 3.6 and 3.7 have been released.

Differential Revision: https://reviews.llvm.org/D64444

Patch from Christian Biesinger <cbiesinger@google.com>!

llvm-svn: 365688
2019-07-10 19:18:38 +00:00
Stefan Granitz bf223dff7e [CMake][NFC] Remove dead code lldb_append_link_flags() from AddLLDB.cmake
llvm-svn: 365651
2019-07-10 16:02:46 +00:00
Stefan Granitz 86d3c9fd1f [CMake][NFC] Polish comments in AddLLDB.cmake
llvm-svn: 365650
2019-07-10 16:00:03 +00:00
Stefan Granitz f554ce7f92 [CMake] Add Apple-lldb-Linux.cmake cache
llvm-svn: 365649
2019-07-10 15:59:56 +00:00
Stefan Granitz 839e305eb1 [CMake] Polish Apple-lldb caches
llvm-svn: 365648
2019-07-10 15:59:50 +00:00
Stefan Granitz 110f97632e [CMake] `install-distribution` for LLDB on Darwin
Summary:
There's a number of requirements for installing LLDB on macOS that are untypical for LLVM projects: use special install-prefix for LLDB.framework, ship headers and tools as framework resources, patch RPATHs, externalize debug-info to dSYM's and strip binaries with `-ST`. For some of it we could use `llvm_externalize_debuginfo()` in the past and just add special cases. However, this complicates the code for all projects and comes with the major drawback, that it adds all these actions at build-time, i.e. dSYM creation and stripping take a lot of time and don't make sense at build-time.

LLVM's distribution mechanism (https://llvm.org/docs/BuildingADistribution.html) appears to be the natural candidate to install LLDB. Based on D64399 (enable in standalone builds), this patch integrates framework installation with the distribution mechanism and adds custom stripping flags and dSYM creation at install-time. Unlike the abandoned D61952, it leaves build-tree binaries untouched, so there's no side-effects on testing. Potential install-order issues must be handled externally.

Please let me know what you think, while I run a few more tests and add remarks+documentation.

Reviewers: xiaobai, compnerd, JDevlieghere, davide, labath, mgorny

Reviewed By: xiaobai, JDevlieghere

Subscribers: lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64408

llvm-svn: 365617
2019-07-10 11:09:29 +00:00
Stefan Granitz 05adc0f317 [CMake] Distribution builds for LLDB standalone
Summary:
Enable `distribution` and `install-distribution` targets in LLDB standalone and pre-populate the cache accordingly on macOS.
Documentation for distribution builds is here: https://llvm.org/docs/BuildingADistribution.html

Reviewers: xiaobai, mgorny, JDevlieghere, davide, compnerd

Reviewed By: xiaobai, JDevlieghere

Subscribers: lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64399

llvm-svn: 365616
2019-07-10 11:09:11 +00:00
Stefan Granitz 685911ffce [CMake] Remove extra lldb-framework target
Summary: The custom lldb-framework target was meant to encapsulate all build steps that LLDB.framework needs on top of the ordinaly liblldb. In the end all of it happens in post-build steps, so we can do the same with liblldb and cut down another source of confusion.

Reviewers: xiaobai, JDevlieghere

Reviewed By: xiaobai, JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64397

llvm-svn: 365615
2019-07-10 11:09:01 +00:00
Stefan Granitz e5b868d6a3 [CMake] Polish a comment
llvm-svn: 365459
2019-07-09 10:29:07 +00:00
Stefan Granitz e9298dc902 [CMake] Don't initialize LLVM_INSTALL_TOOLCHAIN_ONLY in Apple-lldb-base cache
llvm-svn: 365458
2019-07-09 10:29:00 +00:00
Stefan Granitz 189355f3ee [CMake] Remove old lldb_setup_framework_rpaths_in_tool()
llvm-svn: 365457
2019-07-09 10:28:53 +00:00
Stefan Granitz 1665dd6346 [CMake] Avoid libcxxabi dependency when building LLDB from the monorepo on macOS
libc++abi became mandatory to link the libc++ binaries. LLDB only needs the build artifacts and not the linked output (we don't ship `libc++.dylib` and/or `libc++.a`). Disable the respective link steps to avoid the dependency to libc++abi.

<rdar://problem/51980716>

llvm-svn: 365038
2019-07-03 13:21:48 +00:00
Jason Molenda 37aeca39ba Update cmake build setup so lldb doesn't link against the DebugSymbols
framework on macOS, in line with the source/xcode project changes in
r364243.
<rdar://problem/49458356> 

llvm-svn: 364979
2019-07-02 23:36:39 +00:00
Stefan Granitz f2ffa7320e Specify log level for CMake messages (less stderr)
Summary:
Specify message levels in CMake. Prefer STATUS (stdout).

As the default message mode (i.e. level) is NOTICE in CMake, more then necessary messages get printed to stderr. Some tools,  noticably ccmake treat this as an error and require additional confirmation and re-running CMake's configuration step.

This commit specifies a mode (either STATUS or WARNING or FATAL_ERROR)  instead of the default.

* I used `csearch -f 'llvm-project/.+(CMakeLists\.txt|cmake)' -l 'message\("'` to find all locations.
* Reviewers were chosen by the most common authors of specific files. If there are more suitable reviewers for these CMake changes, please let me know.

Patch by: Christoph Siedentop

Reviewers: zturner, beanz, xiaobai, kbobyrev, lebedev.ri, sgraenitz

Reviewed By: sgraenitz

Subscribers: mgorny, lebedev.ri, #sanitizers, lldb-commits, llvm-commits

Tags: #sanitizers, #lldb, #llvm

Differential Revision: https://reviews.llvm.org/D63370

llvm-svn: 363821
2019-06-19 15:25:32 +00:00
Stefan Granitz a0781b6e3a [CMake] Fix generated Xcode-project ignoring output directory setting for LLDB.framework
Other generators honor the `LIBRARY_OUTPUT_DIRECTORY` target property, but apparently Xcode doesn't. So we call `set_output_directory()` as `llvm_add_library()` would do and this works.
Note that `LIBRARY_OUTPUT_DIRECTORY` is still necessary, because it's used to store and read the target's absolute build directory (while `LLDB_FRAMEWORK_BUILD_DIR` is relative!).

llvm-svn: 363280
2019-06-13 17:35:50 +00:00
Stefan Granitz 8f30e322ab [CMake] Add fallbacks for copying clang-resource-headers to LLDB.framework in standalone builds
llvm-svn: 363271
2019-06-13 15:07:56 +00:00
Adrian McCarthy a4198c22dc NFC: Fix typo in a cmake message
llvm-svn: 362845
2019-06-07 21:14:01 +00:00
Stefan Granitz c769462438 [CMake] Add configuration dirs as potential locations for llvm-lit and llvm-tblgen in standalone builds
Summary:
If the provided LLVM build-tree used a multi-configuration generator like Xcode, `LLVM_TOOLS_BINARY_DIR` will have a generator-specific placeholder to express `CMAKE_CFG_INTDIR`. Thus `llvm-lit` and `llvm-tblgen` won't be found.
D62878 exports the actual configuration types so we can fix the path and add them to the search paths for `find_program()`.

Reviewers: xiaobai, labath, stella.stamenova

Reviewed By: xiaobai, stella.stamenova

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D62879

llvm-svn: 362589
2019-06-05 08:31:50 +00:00
Stefan Granitz e4ad1b7bbe [CMake] Move and add settings to Apple-lldb-base cache script
llvm-svn: 362500
2019-06-04 14:21:48 +00:00
Stefan Granitz 5dc9036746 [CMake] LLDB.framework tools handling
Summary:
Modify the way LLDB.framework tools are collected. This allows for better fine-tuning of the install behavior downstream. Each target calls `lldb_add_to_framework()` individually. When entering the function, the target exists and we can tweak its very own post-build and install steps. This was not possible with the old `LLDB_FRAMEWORK_TOOLS` approach.

No function change otherwise.
This is a reduced follow-up from the proposal in D61952.

Reviewers: xiaobai, compnerd, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: clayborg, friss, ki.stfu, mgorny, lldb-commits, labath, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D62472

llvm-svn: 361946
2019-05-29 11:26:06 +00:00
Saleem Abdulrasool 99e040b3c9 build: only search for the needed python type
Windows has different types of runtime libraries which are ABI
incompatible with one another.  This requires that the debug build of
lldb link against the debug build of python.  Adjust the python search
to search for only the required type of python.  This permits building a
release build of lldb against just the release build of python.

llvm-svn: 361915
2019-05-29 02:26:29 +00:00
Stefan Granitz a3388e5f9e [CMake] Folder structure for generated Xcode project to cover more targets
llvm-svn: 361799
2019-05-28 09:29:05 +00:00
Stefan Granitz fd0779181f [CMake] Add first CMake cache files
Summary:
CMake cache scripts pre-populate the CMakeCache in a build directory with commonly used settings.
The CMake invocation from D61952 could look like this:

```
cmake -G Ninja -C /path/to/llvm-project/lldb/cmake/caches/Apple-lldb-osx.cmake -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;lldb" ../llvm-project/llvm
```

Options specified on the command line will override options in the cache files (as long as caches don't use `FORCE`).
What do you think? (This is a first proposal and not set in stone.)

Reviewers: xiaobai, compnerd, JDevlieghere, aprantl, labath

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D61956

llvm-svn: 361069
2019-05-17 19:19:41 +00:00
Pavel Labath 56f9afaf6b [CMake] Correctly reinstate LLDB_CAN_USE_LLDB_SERVER
r360631 introduced a "syntax error" which meant that cmake was still not
honoring the value of LLDB_CAN_USE_LLDB_SERVER variable. The correct
syntax for seting an internal cache variable is "set(VAR value CACHE
INTERNAL)", but the patch omitted the "CACHE" keyword. The "syntax
error" is in quotes because without the CACHE keyword this is still
valid syntax for setting the value of LLDB_CAN_USE_LLDB_SERVER to "1
INTERNAL".

There doesn't seem to be a need for this to be a cache variable so I'm
reverting this variable to a plain one, as it was before r360621.

This will hopefully fix the windows build.

llvm-svn: 360652
2019-05-14 08:18:06 +00:00
Jonas Devlieghere 1d8b2a0661 [CMake] Reinstate LLDB_CAN_USE_LLDB_SERVER
We cannot manipulate the LLDB_TOOL_LLDB_SERVER_BUILD directly from
LLDBConfig.cmake because this would set the variable before the option
is defined in AddLLVM.cmake. Instead, we need to use the
LLDB_CAN_USE_LLDB_SERVER variable to conditionally add the lldb-server
subdirectory. This should ensure the variable doesn't get cleared.

llvm-svn: 360631
2019-05-13 22:55:11 +00:00
Jonas Devlieghere aeeeb37e37 [CMake] Simplify lldb-server handling
We can piggyback off the existing add_lldb_tool_subdirectory to decide
whether or not lldb-server should be built.

Differential revision: https://reviews.llvm.org/D61872

llvm-svn: 360621
2019-05-13 21:25:02 +00:00
Alex Langford babcbaf971 [CMake] Fix subtle CMake bug
CMake specifies that the DEPENDS field of add_custom_target is for files
and output of add_custom_command. In order to add a target dependency,
add_dependencies should be used.

llvm-svn: 359490
2019-04-29 19:44:43 +00:00
Frederic Riss 8ecb7bbe2b [CMake] Remove Apple-specific version logic.
We were using the LLDB-Info.plist as the canonical holder of the
version number, but there is really no good reason to do this. If
anything the plist should be generated using the information provided
to CMake.

For now just remove the logic extracting the version from the plist
and rely on LLDB_VERSION_STRING.

llvm-svn: 358604
2019-04-17 18:23:22 +00:00
Davide Italiano 6df6895d90 [tools] Make vscode and lldb-instr optional.
Summary:
Saves some build times, and they're not part of the usual
developer workflow.

Reviewers: JDevlieghere, friss

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D60780

llvm-svn: 358528
2019-04-16 21:15:28 +00:00
Alex Langford 7e7f79ccb1 [CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds
Summary:
This line is unnecessary because add_llvm_executable will handle
linking the correct LLVM libraries for you. LLDB standalone builds are totally
fine without this.

In the best case, having this line here is harmless. In the worst case it can
cause link issues.

If you build lldb-server for android using the standalone build, this line
will cause LLVM_LIBRARY_DIR to be the first place you look for libraries.
This is an issue because if you built libc++, it will try to link against
that one instead of the one from the android NDK.  Meanwhile, the LLVM libraries
you're linking against were linked against the libc++ from the NDK.

Ideally, we would take advantage of the AFTER option for link_directories(), but
that was not available in LLDB's minimum supported version of CMake (CMake 3.4.3).

Differential Revision: https://reviews.llvm.org/D60180

llvm-svn: 357817
2019-04-05 21:01:50 +00:00
Jonas Devlieghere ae1cc995e3 [Cmake] Unify python variables
FindPythonInterp and FindPythonLibs do two things, they set some
variables (PYTHON_LIBRARIES, PYTHON_INCLUDE_DIRS) and update the cached
variables (PYTHON_LIBRARY, PYTHON_INCLUDE_DIR) which are also used to
specify a custom python installation.

I believe the canonical way to do this is to use the PYTHON_LIBRARIES
and PYTHON_INCLUDE_DIRS variables instead of the cached ones. However,
since the cached variables are accessible from the cache and GUI, this
is a lot less confusing when you're trying to debug why a variable did
or didn't get the value you expected. Furthermore, as far as I can tell,
the implementation uses the cached variables to set their LIBRARIES/DIRS
counterparts. This is also the reason this works today even though we
mix-and-match.

Differential revision: https://reviews.llvm.org/D59968

llvm-svn: 357282
2019-03-29 17:35:42 +00:00
Alex Langford b4a3b29d16 [CMake] Set LLVM_DEFAULT_EXTERNAL_LIT in standalone build correctly on windows
LLVM installed llvm-lit with a .py suffix on windows. Let's match that
behavior here.

llvm-svn: 356412
2019-03-18 21:32:31 +00:00
Pavel Labath 1de5a2ef96 Fix a typo in FindLibEdit.cmake
The package name is LibEdit, so we should use that name in the call to
find_package_handle_standard_args. Failing to do so results in the
standard_args (such as the one telling us whether REQUIRED was used in
the find_package invocation) not being handled.

llvm-svn: 356263
2019-03-15 14:03:52 +00:00
Stefan Granitz 02e88490c1 Revert "[CMake] Avoid clang-tablegen-targets dependency when building sphinx docs (experimental)"
This reverts commit 511066858d.
This turned out unnecessary to fix the bot.

llvm-svn: 355931
2019-03-12 15:54:35 +00:00
Jonas Devlieghere 511066858d [CMake] Avoid clang-tablegen-targets dependency when building sphinx docs (experimental)
Proposal to fix bot
http://lab.llvm.org:8011/builders/lldb-sphinx-docs/builds/1564/steps/cmake-configure/logs/stdio

Patch by: Stefan Gränitz

Differential revision: https://reviews.llvm.org/D59232

llvm-svn: 355887
2019-03-12 00:49:10 +00:00
Shoaib Meenai 5be71faf4b [build] Rename clang-headers to clang-resource-headers
Summary:
The current install-clang-headers target installs clang's resource
directory headers. This is different from the install-llvm-headers
target, which installs LLVM's API headers. We want to introduce the
corresponding target to clang, and the natural name for that new target
would be install-clang-headers. Rename the existing target to
install-clang-resource-headers to free up the install-clang-headers name
for the new target, following the discussion on cfe-dev [1].

I didn't find any bots on zorg referencing install-clang-headers. I'll
send out another PSA to cfe-dev to accompany this rename.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html

Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille

Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits

Tags: #clang, #sanitizers, #lldb, #openmp, #llvm

Differential Revision: https://reviews.llvm.org/D58791

llvm-svn: 355340
2019-03-04 21:19:53 +00:00
Pavel Labath 5d4d168c3c [cmake] Move LLDB_DISABLE_LIBEDIT handling code into a central place
This was previously scattered between the main CMakeLists.txt file and
LLDBGenerateConfig.cmake and LLDBConfig.cmake. This caused the some of
the code to be executed in incorrect order. Specifically, the check for
el_winsertstr was done before libedit_LIBRARIES was computed, and so it
always failed on the first run.

Moving it the two checks to a central place makes sure this doesn't
happen again and improves the overall readability.

llvm-svn: 355103
2019-02-28 16:04:54 +00:00
Stefan Granitz db85fdd115 [CMake] Fix RPATH handling for LLDB.framework
Summary:
Generator expressions are not supported in the `BUILD_RPATH` target property.
`BUILD_RPATH` is only supported in 3.8+ https://cliutils.gitlab.io/modern-cmake/chapters/intro/newcmake.html
`LLDB_FRAMEWORK_INSTALL_DIR` should not overwrite, but rather add an install RPATH (and it should be the first)

Reviewers: xiaobai, lanza

Reviewed By: xiaobai

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D57989

llvm-svn: 354037
2019-02-14 17:34:39 +00:00
Michal Gorny e47f89cb2c [lldb] [cmake] Use install directories for LLVM_* variables
Restore the previous behavior of using install directories for
LLVM_MAIN_INCLUDE_DIR, LLVM_LIBRARY_DIR and LLVM_BINARY_DIR.  The update
from llvm-config to CMake has changed the values of those values to use
LLVM_BUILD_* which is plain wrong and breaks stand-alone builds.
Instead, use the CMake counterparts of the values returned
by llvm-config.

Differential Revision: https://reviews.llvm.org/D57995

llvm-svn: 353925
2019-02-13 08:34:46 +00:00
Stefan Granitz f4283858fa [CMake] Accept entitlements for code signing in add_lldb_library()
Summary:
D57334 added entitlements support in `add_llvm_library()` so we can use it for library targets in LLDB.

Additionally this patch fixes the way that the entitlements argument is passed on from `add_lldb_executable()` to `add_llvm_executable()`. We still need the explicit parsing and passing on of single- and multi-value arguments as long as we are on CMake < 3.7 (due to bug https://gitlab.kitware.com/cmake/cmake/merge_requests/133).

Reviewers: beanz, JDevlieghere, aprantl

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D57378

llvm-svn: 352629
2019-01-30 15:13:16 +00:00
Stefan Granitz 1f34e851ee [CMake] Dump LLDB.framework tools at configuration time
llvm-svn: 352387
2019-01-28 16:57:19 +00:00
Stefan Granitz a50cce2266 [CMake] Quick-Fix targets don't exist when building against LLVM install-tree with LLDB_INCLUDE_TESTS=ON
The issue came up during release testing for LLVM 8: https://bugs.llvm.org/show_bug.cgi?id=40443

Differential Revision: https://reviews.llvm.org/D57233

llvm-svn: 352382
2019-01-28 16:15:27 +00:00
Michal Gorny d4b194cf95 [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always
Refactor the get_llvm_lit_path() logic to respect LLVM_EXTERNAL_LIT,
and require the fallback to be defined explicitly
as LLVM_DEFAULT_EXTERNAL_LIT. This fixes building libcxx standalone
after r346888.

The old logic was using LLVM_EXTERNAL_LIT both as user-defined cache
variable and an optional pre-definition of default value from caller
(e.g. libcxx). It included a hack to make this work by assigning
the value back and forth but it was fragile and stopped working
in libcxx.

The new logic is simpler and more transparent. Default value is
provided in a separate variable, and used only when user-specified
variable is empty (i.e. not overriden).

Differential Revision: https://reviews.llvm.org/D57282

llvm-svn: 352374
2019-01-28 15:16:03 +00:00
Alex Langford 165ea58798 [CMake] Use llvm-tblgen from NATIVE LLVM build when cross-compiling
Summary:
When cross-compiling LLDB, we want to use llvm-tblgen built for the
host, not the target.

Reviewers: compnerd, sgraenitz

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D57194

llvm-svn: 352235
2019-01-25 19:38:21 +00:00
Alex Langford 43eb71b4c2 [CMake] Remove duplicated cache variable. NFC.
llvm-svn: 352078
2019-01-24 18:52:19 +00:00
Stefan Granitz f7098b3a04 [CMake] Get back some variables used in AddLLVM.cmake
This fixes 'gtest/gtest.h' file not found when building unit tests after r351863.

llvm-svn: 352058
2019-01-24 16:02:21 +00:00
Stefan Granitz fea3731f37 [CMake] Fix two details from r351863
llvm-svn: 351879
2019-01-22 21:14:51 +00:00
Alex Langford b8ecd7e49b [CMake] Replace use of llvm-config with LLVM and Clang CMake packages
Summary:
I did this for two reasons:
- Using the CMake packages simplifies building LLDB Standalone. This is for two
  reasons: 1) We were doing a decent amount of work that is already done in the
  LLVMConfig.cmake that we want to import, 2) We had to do some manual work to call
  llvm-config, parse its output, and populate variables that the build system
  uses.
- As far as I understand, using llvm-config makes it difficult if not impossible
  to cross-compile LLDB standalone.

Reviewers: sgraenitz, labath, zturner, JDevlieghere, davide, aprantl, stella.stamenova

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D56531

llvm-svn: 351863
2019-01-22 19:26:42 +00:00
Stefan Granitz 16be420953 [CMake] Turn LLDB_FRAMEWORK_TOOLS into STRING to allow overrides from cache files
llvm-svn: 351830
2019-01-22 15:59:47 +00:00
Stefan Granitz bb3df52c0c [CMake] Include tests by default also in standalone builds
In-tree builds include tests by default. Standalone builds should behave the same.

llvm-svn: 350945
2019-01-11 18:11:04 +00:00