summaryrefslogtreecommitdiffstats
path: root/lldb/cmake/modules/LLDBStandalone.cmake
Commit message (Collapse)AuthorAgeFilesLines
* [lldb][CMake] Infer `Clang_DIR` if not passed explicitlyStefan Granitz2019-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: If we only get `LLVM_DIR` and find Clang in the same provided build-tree, automatically infer `Clang_DIR` like this: ``` LLVM_DIR = /path/to/build-llvm/lib/cmake/llvm Clang_DIR = /paht/to/build-llvm/lib/cmake/clang ``` Reviewers: JDevlieghere, jingham, xiaobai, compnerd, labath Reviewed By: JDevlieghere, labath Subscribers: mgorny, lldb-commits, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D65798 llvm-svn: 372210
* [CMake] Move project() call to main CMake fileHaibo Huang2019-07-291-2/+0
| | | | | | | | | | | | | | | Summary: The main CMake file don't have a project() call. In this case, cmake will run a dummy project(Project ) at the very beginning. Even before cmake_minimum_required. And a series of compiler detections will be triggered. This is problematic if we depends on some policy to be set. E.g. CMP0056. try_compile will fail before we have a chance to do anything. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65362 llvm-svn: 367273
* build: allow the user to specify `llvm-tblgen`Saleem Abdulrasool2019-07-201-23/+27
| | | | | | | | | | | | This follows the same pattern as Clang and permits the user to specify the tablegen to use via `-DLLVM_TABLEGEN=`. This allows for cross-compiling LLDB for a foreign target (e.g. Windows ARM64 on Windows X64). The LLVM dependency for LLDB in that case must be a Windows ARM64 build which cannot cross-compile llvm-tblgen due to the way that Visual Studio works. Instead, permit the user to have a separate tablegen build which can be used during the build. llvm-svn: 366639
* [CMake] Remove duplicated logic to find Python when doing a standalone buildJonas Devlieghere2019-07-171-12/+0
| | | | | | | | | | | I'm pretty sure there's no need to have this logic living in LLDBStandalone. It doesn't appear anything in LLVM depends on this, and We always go through LLDBConfig.cmake which has the canonical way to find the Python libs and interpreter for LLDB. Differential revision: https://reviews.llvm.org/D64821 llvm-svn: 366363
* [CMake] Use LLVM_DIR and Clang_DIR for standalone builds.Jonas Devlieghere2019-07-171-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing a standalone build, without setting LLDB_PATH_TO_LLVM_BUILD or LLDB_PATH_TO_CLANG_BUILD, you get the following error. ``` CMake Error at cmake/modules/LLDBStandalone.cmake:23 (find_package): Could not find a package configuration file provided by "LLVM" with any of the following names: LLVMConfig.cmake llvm-config.cmake Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set "LLVM_DIR" to a directory containing one of the above files. If "LLVM" provides a separate development package or SDK, be sure it has been installed. ``` This suggests setting LLVM_DIR to LLVM's install directory. However, LLDBStandalone.cmake takes LLDB_PATH_TO_LLVM_BUILD as its hint. As someone who isn't familiar with the standalone process, this is rather confusing. This patch removes LLDB_PATH_TO_LLVM_BUILD and LLDB_PATH_TO_CLANG_BUILD and instead use LLVM_DIR and Clang_DIR respectively. Differential revision: https://reviews.llvm.org/D64823 llvm-svn: 366362
* [CMake] Move standalone check so we don't have to reconfigure LLDBJonas Devlieghere2019-07-171-99/+96
| | | | | | | | | | | | | By moving the standalone check into the main CMake file, the whole file is ignored in a regular (non-standalone) build. This means that you can make changes to LLDBStandalone.cmake without having to reconfigure a build in a different directory. This matters when you share one source repository with different build directories (e.g. release-assert, debug, standalone). Differential revision: https://reviews.llvm.org/D64824 llvm-svn: 366346
* Make Python version setting actually effectiveJonas Devlieghere2019-07-131-1/+1
| | | | | | | | | | | This needs to be outside the if to actually work. Also, this adjusts the list of versions to match LLVM. Patch by: Christian Biesinger Differential revision: https://reviews.llvm.org/D64578 llvm-svn: 365988
* Add Python 3.6 and 3.7 to the version listNico Weber2019-07-101-1/+1
| | | | | | | | | | 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
* [CMake] Distribution builds for LLDB standaloneStefan Granitz2019-07-101-0/+1
| | | | | | | | | | | | | | | | | | 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
* Specify log level for CMake messages (less stderr)Stefan Granitz2019-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [CMake] Add configuration dirs as potential locations for llvm-lit and ↵Stefan Granitz2019-06-051-3/+16
| | | | | | | | | | | | | | | | | | | | 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
* [CMake] Folder structure for generated Xcode project to cover more targetsStefan Granitz2019-05-281-0/+8
| | | | llvm-svn: 361799
* [CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone buildsAlex Langford2019-04-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | 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
* [CMake] Set LLVM_DEFAULT_EXTERNAL_LIT in standalone build correctly on windowsAlex Langford2019-03-181-1/+6
| | | | | | | LLVM installed llvm-lit with a .py suffix on windows. Let's match that behavior here. llvm-svn: 356412
* [lldb] [cmake] Use install directories for LLVM_* variablesMichal Gorny2019-02-131-3/+3
| | | | | | | | | | | | | 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
* [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT alwaysMichal Gorny2019-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* [CMake] Use llvm-tblgen from NATIVE LLVM build when cross-compilingAlex Langford2019-01-251-2/+25
| | | | | | | | | | | | | | 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
* [CMake] Remove duplicated cache variable. NFC.Alex Langford2019-01-241-2/+0
| | | | llvm-svn: 352078
* [CMake] Get back some variables used in AddLLVM.cmakeStefan Granitz2019-01-241-0/+5
| | | | | | This fixes 'gtest/gtest.h' file not found when building unit tests after r351863. llvm-svn: 352058
* [CMake] Fix two details from r351863Stefan Granitz2019-01-221-3/+3
| | | | llvm-svn: 351879
* [CMake] Replace use of llvm-config with LLVM and Clang CMake packagesAlex Langford2019-01-221-77/+20
| | | | | | | | | | | | | | | | | | | | 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
* [CMake] Include tests by default also in standalone buildsStefan Granitz2019-01-111-0/+1
| | | | | | In-tree builds include tests by default. Standalone builds should behave the same. llvm-svn: 350945
* [CMake] Remove dead code and outdated commentsStefan Granitz2019-01-111-1/+0
| | | | | | | | | | | | | | Summary: All of these changes are NOPs. Reviewers: stella.stamenova, labath, JDevlieghere Reviewed By: stella.stamenova Subscribers: mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D56609 llvm-svn: 350937
* [CMake] In standalone builds, LLVM_BINARY_DIR should point to LLVM's binary ↵Stefan Granitz2019-01-091-3/+1
| | | | | | | | | | | | | | | | directory Summary: In standalone builds `LLVM_BINARY_DIR` was equal to `LLDB_BINARY_DIR` so far. This is counterintuitive and invalidated the values of `LLDB_DEFAULT_TEST_DSYMUTIL/FILECHECK/COMPILER` etc. Reviewers: zturner, labath, clayborg, JDevlieghere, stella.stamenova, serge-sans-paille Reviewed By: labath Subscribers: mgorny, friss, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D56443 llvm-svn: 350738
* Make standalone build find tabelgenJonas Devlieghere2018-11-281-0/+1
| | | | | | | The standalone build couldn't find tablegen because we didn't include it. This patch rectifies that. llvm-svn: 347814
* Fix typo in CMake commentsAlex Langford2018-05-251-2/+2
| | | | llvm-svn: 333299
* LLDBStandalone.cmake: set path to llvm-lit inside of llvm build dirAdrian Prantl2018-03-051-0/+1
| | | | llvm-svn: 326754
* [CMake] NFC. Cleanup unnecessary CMake policyChris Bieneman2017-07-251-4/+0
| | | | | | This is just setting to the default behavior, so it does nothing. llvm-svn: 309022
* [CMake] [NFC] Remove out of date and redundant version requirementChris Bieneman2017-07-181-1/+0
| | | | | | Since we set the minimum required version elsewhere to be higher this actually has meaningful good impact. llvm-svn: 308376
* CMake requires normalized paths when appending.Zachary Turner2017-03-171-0/+1
| | | | | | | Patch by Hugh Bellamy Differential Revision: https://reviews.llvm.org/D30927 llvm-svn: 298100
* [cmake] Obtain LLVM_CMAKE_PATH from llvm-configMichal Gorny2017-01-091-2/+3
| | | | | | | Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from llvm-config instead of reconstructing it locally. llvm-svn: 291500
* Fixes for standalone build:Eugene Zelenko2016-07-151-0/+2
| | | | | | | | | * include CheckAtomic to set HAVE_CXX_ATOMICS64_WITHOUT_LIB properly (introduced in r274121) * hint Clang CMake files for LLVM CMake files location (inctroduced in ~ r274176) Differential revision: https://reviews.llvm.org/D22322 llvm-svn: 275641
* Fix standalone LLDB build, when LLVM/Clang were built with ↵Eugene Zelenko2016-05-181-1/+19
| | | | | | | | | | LLVM_INSTALL_TOOLCHAIN_ONLY=ON. Fix standalone build with CMake 2.8.12.2. Differential revision: http://reviews.llvm.org/D20344 llvm-svn: 269996
* Add CMake bits necessary for standalone buildKamil Rytarowski2016-05-121-49/+64
| | | | | | | | | | | | Summary: Developed on NetBSD with pkgsrc. Reviewers: zturner, labath Subscribers: jevinskie, zturner, tfiala, Eugene.Zelenko, artagnon, joerg, lldb-commits Differential Revision: http://reviews.llvm.org/D15067 llvm-svn: 269332
* Fix NetBSD build with CMake 3.5.2Kamil Rytarowski2016-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Building HEAD of LLDB fails in linking against DebugInfoPDB. It also prints the following warning: ``` CMake Warning (dev) in source/Plugins/SymbolFile/PDB/CMakeLists.txt: Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link interface. Run "cmake --help-policy CMP0022" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Target "lldbPluginSymbolFilePDB" has an INTERFACE_LINK_LIBRARIES property. This should be preferred as the source of the link interface for this library but because CMP0022 is not set CMake is ignoring the property and using the link implementation as the link interface instead. INTERFACE_LINK_LIBRARIES: LLVMDebugInfoPDB Link implementation: (empty) ``` CMP0022 was introduced in CMake-2.8.11, bump minimal required version from 2.8 to 3.0 to gain more useful features like libexecinfo(3) detection on NetBSD. Reviewers: emaste, zturner, labath Subscribers: zturner, lldb-commits, joerg Differential Revision: http://reviews.llvm.org/D19685 llvm-svn: 268191
* Fix the search path for CMake filesNiels Ole Salscheider2016-02-041-4/+4
| | | | | | | This allows to find the LLVM's CMake files after moving them in r259821. llvm-svn: 259845
* LLDBStandalone: Report nice errors on missing varsRamkumar Ramachandra2015-11-101-7/+17
| | | | | | Differential Revision: http://reviews.llvm.org/D13819 llvm-svn: 252624
* Teach CMake to find versions of Python != 2.7Zachary Turner2015-10-061-2/+1
| | | | llvm-svn: 249466
* Standalone cmake build improvements (bug #23889)Pavel Labath2015-07-171-0/+1
| | | | | | patch by Eugene Zelenko. llvm-svn: 242529
* LLDB standalone build: check if Clang was built independently from LLVMPavel Labath2015-07-071-1/+3
| | | | | | | | | | This is fix for bug 23704: LLDB standalone build always include ClangConfig.cmake even if Clang was built with LLVM (ClangConfig.cmake doesn't exist). Patch by: Eugene Zelenko llvm-svn: 241575
* Remove DOS line endings from LLDBStandalone.cmakeEd Maste2015-07-031-87/+87
| | | | llvm-svn: 241361
* Add Support for LLVM_INSTALL_TOOLCHAIN_ONLY (bug #23784)Pavel Labath2015-06-291-0/+2
| | | | | | | | | Support for LLVM_INSTALL_TOOLCHAIN_ONLY is modeled on same functionality from LLVM and Clang CMake files. Patch by: Eugene Zelenko llvm-svn: 240935
* [CMake] Refactor LLDB main CMake file.Zachary Turner2015-03-021-0/+85
The existing state of affairs was getting a little unwieldy. All of LLDB's utility functions and initial configuration was in the root CMake file. I split this up into 3 separate files and moved them to relevant subfolders under cmake/modules. Also, I deleted the add_lldb_definitions() function. It seemed to be somewhat useless and did not serve any real purpose that I was able to figure out. llvm-svn: 231010
OpenPOWER on IntegriCloud