Commit Graph

1199 Commits

Author SHA1 Message Date
Pengxuan Zheng e364a4d5a2 [cmake] Allow config.guess to be run with MSYS on Windows
Summary:
With r363420, config.guess can no longer be run with MSYS on Windows and this
patch should be able to fix this particular case.

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364485 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 22:07:43 +00:00
Hans Wennborg 193048cd6f Add llvm-symbolizer to LLVM_TOOLCHAIN_TOOLS (PR40152)
So that it gets installed in LLVM_INSTALL_TOOLCHAIN_ONLY builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364277 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-25 07:15:41 +00:00
Hans Wennborg 3594f41a5d [LLVM-C] Add LLVM-C.dll to Windows installer package
This is a follow up to D56781, D56774 and D35077 to makes the LLVM-C.dll
file and LLVM-C.lib be installed on Windows, just like LTO.dll and
LTO.lib are.

Patch by Jakob Bornecrantz!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364275 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-25 07:05:00 +00:00
Nico Weber 2f160b4cde Remove flag for no longer supported MSVC version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364218 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-24 18:47:53 +00:00
Stefan Granitz 6e06701337 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363821 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-19 15:25:32 +00:00
Saleem Abdulrasool f27f188798 build: extract LLVM distribution target handling
This extracts the LLVM distribution target handling into a support module.
Extraction will enable us to restructure the builds to support multiple
distribution configurations (e.g. developer and user) to permit us to build the
development package and the user package at once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363440 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 18:28:57 +00:00
Saleem Abdulrasool 963f1cb84d build: don't attempt to run config.guess on Windows
When cross-compiling LLVM to android from Windows (for LLVMSupport), we would
attempt to execute `config.guess` to determine the host triple since
`CMAKE_SYSTEM_NAME` is not Windows and `CMAKE_C_COMPILER` will be set to GNU or
Clang.  This will fail as `config.guess` is a shell script which cannot be
executed on Windows.  Simply log a warning instead.  The user can specify the
value for this instead in those cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363420 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 16:47:04 +00:00
Stefan Granitz 561003e724 [CMake] Export CMAKE_CONFIGURATION_TYPES for the LLVM build-tree
Summary: Useful info for standalone builds of subprojects. If a multi-configuration generator was used for the provided LLVM build-tree, standalone builds should consider actual subdirectories per configuration in `find_program()` (e.g. looking for `llvm-lit` or `llvm-tblgen`).

Reviewers: labath, beanz, mgorny

Subscribers: lldb-commits, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362588 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-05 08:29:24 +00:00
Eugene Leviant e7dba02a1e [HWASAN][CMake] Allow instrumenting LLVM/clang
Differential revision: https://reviews.llvm.org/D62813


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362474 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-04 09:04:53 +00:00
Saleem Abdulrasool 3cd68c8533 tools: add llvm-nm and llvm-objcopy to tools
Add `nm` and `objcopy` to the default value for the tools that we install now
that they are sufficiently feature complete to replace bintuils' implementation.

Patch by Jiang Yi!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362425 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-03 17:17:09 +00:00
Don Hinton 6964f65388 [test] Fix plugin tests
Recommit of r361790 that was temporarily reverted in r361793 due to bot breakage.

Summary:
The following changes were required to fix these tests:

1) Change LLVM_ENABLE_PLUGINS to an option and move it to
   llvm/CMakeLists.txt with an appropriate default -- which matches
   the original default behavior.

2) Move the plugins directory from clang/test/Analysis
   clang/lib/Analysis.  It's not enough to add an exclude to the
   lit.local.cfg file because add_lit_testsuites recurses the tree and
   automatically adds the appropriate `check-` targets, which don't
   make sense for the plugins because they aren't tests and don't
   have `RUN` statements.

   Here's a list of the `clang-check-anlysis*` targets with this
   change:

```
  $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis
  check-clang-analysis
  check-clang-analysis-checkers
  check-clang-analysis-copypaste
  check-clang-analysis-diagnostics
  check-clang-analysis-engine
  check-clang-analysis-exploration_order
  check-clang-analysis-html_diagnostics
  check-clang-analysis-html_diagnostics-relevant_lines
  check-clang-analysis-inlining
  check-clang-analysis-objc
  check-clang-analysis-unified-sources
  check-clang-analysis-z3
```

3) Simplify the logic and only include the subdirectories under
   clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.

Reviewed By: NoQ

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362328 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-02 15:53:43 +00:00
Petr Hosek ce40381734 [CMake] Use libtool for runtimes when building for Apple platform
LLVM CMake build already uses libtool instead of ar when building
for Apple platform and we should be using the same when building
runtimes. To do so, this change extracts the logic for finding
libtool into a separate file and then uses it from both the LLVM
build as well as the LLVM runtimes build.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362313 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-02 02:05:01 +00:00
Chris Bieneman b92659f84c [CMake] Feed BUNDLE_PATH through llvm target wrappers
This feeds the new llvm_codsign BUNDLE_PATH option through from the llvm target wrapper functions, so that you can specify the BUNDLE_PATH on the target's codesign.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362248 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-31 17:40:49 +00:00
Petr Hosek 6a3f589fca [CMake] Provide an option to use relative paths in debug info
CMake always uses absolute file paths in the generated compiler
invocation which results in absolute file paths being embedded in debug
info. This is undesirable when building a toolchain e.g. on bots as the
debug info may embed the bot source checkout path which is meaningless
anywhere else.

This change introduces the LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO which uses
-fdebug-prefix-map (where supported) options to rewrite paths embedded
into debug info with relative ones. Additionally, LLVM_SOURCE_PREFIX can
be used to override the path to source directory with a different one.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362185 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-31 01:34:51 +00:00
Chris Bieneman 3688cb5f72 Support codesigning bundles and forcing
Summary:
Clangd's framework is assembled by copying binaries from the lib and bin directories into a bundle shape. This results in an invalid bundle code signature because the signature only applies to the binaries not the resources.

This patch adds two new options to `llvm_codesign` to enable re-signing the library and XPC service as bundles.

The `BUNDLE_PATH` option allow specifying an explicit path to codesign, which enables signing bundles which aren't generated using CMake's `FRAMEWORK` or `BUNDLE` target properties.

The `FORCE` option allows re-signing binaries that have already been signed. This is required for how clangd exposes the clangd library and tools as both XPC and non-XPC services using the same binary.

Reviewers: jkorous, bogner

Reviewed By: bogner

Subscribers: mgorny, ilya-biryukov, dexonsmith, arphaman, kadircet, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362169 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-30 22:25:48 +00:00
Alexandre Ganea 47415a68f2 Revert r361826, as it still breaks LLDB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361837 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 15:04:39 +00:00
Alexandre Ganea ef1b6ff6b6 [CMake] Default options for faster executables on MSVC
Differential Revision: https://reviews.llvm.org/D55056

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361826 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 14:14:48 +00:00
Don Hinton a3723dfcba Revert [test] Fix plugin tests
This reverts r361790 (git commit fe5eaab2b5b4523886bd63aebcfea8cfce586fa1)

It's causing buildbot breakage, so reverting while I investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361793 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 06:38:16 +00:00
Don Hinton d4583c9395 [test] Fix plugin tests
Summary:
The following changes were required to fix these tests:

1) Change LLVM_ENABLE_PLUGINS to an option and move it to
   llvm/CMakeLists.txt with an appropriate default -- which matches
   the original default behavior.

2) Move the plugins directory from clang/test/Analysis
   clang/lib/Analysis.  It's not enough to add an exclude to the
   lit.local.cfg file because add_lit_testsuites recurses the tree and
   automatically adds the appropriate `check-` targets, which don't
   make sense for the plugins because they aren't tests and don't
   have `RUN` statements.

   Here's a list of the `clang-check-anlysis*` targets with this
   change:

```
  $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis
  check-clang-analysis
  check-clang-analysis-checkers
  check-clang-analysis-copypaste
  check-clang-analysis-diagnostics
  check-clang-analysis-engine
  check-clang-analysis-exploration_order
  check-clang-analysis-html_diagnostics
  check-clang-analysis-html_diagnostics-relevant_lines
  check-clang-analysis-inlining
  check-clang-analysis-objc
  check-clang-analysis-unified-sources
  check-clang-analysis-z3
```

3) Simplify the logic and only include the subdirectories under
   clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.

Reviewed By: NoQ

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361790 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 06:26:58 +00:00
Akira Hatanaka 6a44b6ab67 Revert "[Analysis] Link library dependencies to Analysis plugins"
This reverts commit r361340. The following builder has been broken for
the past few days because of this commit:

http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/

Also revert r361399, which was committed to fix r361340.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361685 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-25 00:50:03 +00:00
Daniel Sanders aad362fafd Fix BUILD_SHARED_LIBS builds after r361567
Also fixed a comment I noticed while debugging this build


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361591 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-24 02:15:27 +00:00
Daniel Sanders 6519fa1cbe Break false dependencies on target libraries
Summary:
For the most part this consists of replacing ${LLVM_TARGETS_TO_BUILD} with
some combination of AllTargets* so that they depend on specific components
of a target backend rather than all of it. The overall effect of this is
that, for example, tools like opt no longer falsely depend on the
disassembler, while tools like llvm-ar no longer depend on the code
generator.

There's a couple quirks to point out here:
* AllTargetsCodeGens is a bit more prevalent than expected. Tools like dsymutil
  seem to need it which I was surprised by.
* llvm-xray linked to all the backends but doesn't seem to need any of them.
  It builds and passes the tests so that seems to be correct.
* I left gold out as it's not built when binutils is not available so I'm
  unable to test it

Reviewers: bogner, JDevlieghere

Reviewed By: bogner

Subscribers: mehdi_amini, mgorny, steven_wu, dexonsmith, rupprecht, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361567 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-23 23:02:56 +00:00
David Zarzycki 839cd49977 Unbreak non-PIC builds after r361340/D62174
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361399 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-22 15:48:12 +00:00
Petr Hosek 17bca14055 [Analysis] Link library dependencies to Analysis plugins
These are needed to avoid undefined symbols which aren't satisfied
by Clang itself.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361340 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-22 00:47:37 +00:00
Don Hinton 93051efe9b [cmake] Add custom command to touch archives on Darwin so ninja won't rebuild them.
Summary:
clang and newer versions of ninja use high-resolutions timestamps, but
older versions of libtool on Darwin don't, so the archive will often
get an older timestamp than the last object that was added or updated.
To fix this, we add a custom command to touch the archive after it's
been built so that ninja won't rebuild it unnecessarily the next time
it's run.

Reviewed By: beanz

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361280 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-21 17:56:45 +00:00
Petr Hosek c4aea6055d [CMake] Specify component for all target types
This addresses an issue introduced in r360230 which broke existing
use cases of LLVM_DISTRIBUTION_COMPONENTS since ARCHIVE and LIBRARY
target types are no longer handled as components.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361223 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-21 07:13:58 +00:00
Nico Weber 614d096016 Tweaks for setting CMAKE_LINKER to lld-link
- Just look for "lld-link", not "lld-link.exe".
  llvm/cmake/platforms/WinMsvc.cmake for example sets CMAKE_LINKER to
  lld-link without .exe

- Stop passing -gwarf to the compiler in sanitizer options when lld is
  enabled -- there's no reason to use different debug information keyed
  off the linker. (If this was for MinGW, we should check for that
  instead.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361214 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-21 03:01:01 +00:00
Saleem Abdulrasool 2ec48fc90d build: use clang-cl for runtimes when targeting Windows
When targeting Windows and building a runtime (subproject) prefer to use
`clang-cl` rather than the `clang` driver.  This allows us to cross-compile
runtimes for the Windows environment from Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361072 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-17 20:09:06 +00:00
Petr Hosek b547fc76bb [Analysis] Only run plugins tests if plugins are actually enabled
When plugins aren't enabled, don't try to run plugins tests. Don't
enable plugins unconditionally based on the platform, instead check
if LLVM shared library is actually being built which may not be the
case for every host configuration, even if the host itself supports
plugins.

This addresses test failures introduced by r360891/D59464.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360991 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-17 06:07:37 +00:00
Simon Pilgrim ba6583d115 [cmake] Remove MSVC C4800 override
Remove C4800 : ''type' : forcing value to bool 'true' or 'false' (performance warning)' from the list of forced disabled warnings.

I'm not seeing any regressions in VS2017/VS2019 llvm/clang builds from removing this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360417 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-10 10:22:13 +00:00
Simon Pilgrim 08c43ee5f4 [cmake] Remove MSVC C4355 override
Remove C4355 : ''this' : used in base member initializer list' from the list of forced disabled warnings.

I'm not seeing any regressions in VS2017/VS2019 llvm/clang builds from removing this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360413 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-10 09:54:42 +00:00
Simon Pilgrim 2b7a54885d Fix whitespace mismatches. NFCI.
Tabs are not our friends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360248 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-08 13:02:32 +00:00
Martin Storsjo 6c7c3ccf18 [CMake] Install import libraries
Simplify the cmake logic to install both runtime and import
libraries (treated as ARCHIVE), as the later are needed to link
against llvm.

Patch by Julien Schueller!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360230 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-08 08:37:34 +00:00
Xing Xue 92576a984e Add libc++ to link XRay test cases if libc++ is used to build CLANG
Summary: When libc++ is used to build CLANG, its XRay libraries libclang_rt.xray-*.a have dependencies on libc++. Therefore, libc++ is needed to link and run XRay test cases. For Linux -rpath is also needed to specify where to load libc++. This change sets macro LLVM_LIBCXX_USED to 1 if libc++ is actually used in the build. XRay tests then check the flag and add -L<llvm_shlib_dir> -lc++ and -Wl,-rpath=<llvm_shlib_dir> if needed.

Reviewers: hubert.reinterpretcast, amyk, dberris, jasonliu, sfertile, EricWF

Subscribers: dberris, mgorny, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360060 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-06 17:45:21 +00:00
Alexandre Ganea b8b62917a1 Fix CMake Invalid Escape Sequence
Patch by xoviat

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360045 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-06 14:07:01 +00:00
Saleem Abdulrasool 86b49e2b74 build: add option to disable unwind tables
The unwind tables (`.eh_frame`, `.arm.extab`) add a significant chunk of data to
the final binaries.  These should not be needed normally, particularly when
exceptions are disabled.  This enables shrinking `lldb-server` by ~18% (3 MiB)
when built with gold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359819 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-02 19:37:26 +00:00
Russell Gallop 46a00fa36f Add llvm-profdata to LLVM_TOOLCHAIN_TOOLS
This is required for using PGO on Windows but isn't in the Windows
release packages. Windows packages are built with
LLVM_INSTALL_TOOLCHAIN_ONLY so only includes llvm "tools" listed here.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359569 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 15:35:16 +00:00
Russell Gallop 7c027b7c72 [cmake] Fix error message on simulated VS version check
For clang-cl self hosts in VS2015 environment this was reporting: "Host
Clang must have at least -fms-compatibility-version=19.00.24213.1, your
version is 9.0.0".

This check fires as CMake detects the simulated environment as _MSC_VER
1900, which is truncated. This makes it less than the required
19.00.24213.1.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359556 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 12:37:10 +00:00
Simon Atanasyan 7047808b81 [cmake] Disable a GCC optimization when building LLVM for MIPS
GCC when compiling LLVM for MIPS can introduce a jump to an uninitialized
value when shrink wrapping is enabled. As shrink wrapping is enabled in
GCC at all optimization levels, it must be disabled. This bug exists for
all versions of GCC since 4.9.2.

This partially resolves PR37701 / GCC PR target/86069.

Patch by Simon Dardis.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359376 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-27 09:28:54 +00:00
Alex Langford 0734b610d6 [CMake] Use add_dependencies in add_llvm_install_targets
Summary:
The CMake documentation says that the `DEPENDS` field of
add_custom_target is for files and output of custom commands. Adding a
dependency on a target should be done with `add_dependency`.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359042 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 21:59:07 +00:00
Don Hinton 203b6566a1 [cmake] Fix bug in r358779 - [CMake] Pass monorepo build settings in cross compile
Escape semicolons in the targets list so that cmake doesn't expand
them to spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358859 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-21 19:20:13 +00:00
Chris Bieneman 5631cdaf4e [CMake] Pass monorepo build settings in cross compile
This allows the cross compiled build targets to configure the LLVM tools and sub-projects that are part of the main build.

This is needed for generating native non llvm *-tablegen tools when cross compiling clang in the monorepo build environment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358779 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-19 20:08:55 +00:00
Stefan Granitz 814e8a2058 [CMake] Allow custom extensions for externalized debug info
Summary:
Extra flexibility for emitting debug info to external files (remains Darwin only for now).
LLDB needs this functionality to emit a LLDB.framework.dSYM instead of LLDB.dSYM when building the framework, because the latter could conflict with the driver's lldb.dSYM when emitted in the same directory on case-insensitive file systems.

Reviewers: friss, bogner, beanz

Subscribers: mgorny, aprantl, llvm-commits, #lldb

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358685 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-18 16:37:07 +00:00
Dmitri Gribenko 7c29aa7624 Removed CMake cache upgrade code from 2011
Summary:
This code was added in r141266 to make a breaking change to CMake, but
still be compatible with existing cache files.  The cache files from
2011 are irrelevant today in 2019.

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358482 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16 09:46:02 +00:00
Pengxuan Zheng c932a25d56 [cmake] Fix dependency issue in TableGen
Summary:
There is a bug in add_tablegen which causes cmake to fail with the following
error message if LLVM_TABLEGEN is set.

CMake Error at cmake/modules/TableGen.cmake:147 (add_dependencies):
  The dependency target "LLVM-tablegen-host" of target "CLANG-tablegen-host"
  does not exist.
Call Stack (most recent call first):
  tools/clang/utils/TableGen/CMakeLists.txt:3 (add_tablegen)

The issue happens because setting LLVM_TABLEGEN causes cmake to skip generating
the LLVM-tablegen-host target. As a result, a non-existent target was added for
CLANG-tablegen-host causing cmake to fail.

In order to fix this issue, this patch adds a guard to check the validity of the
dependency target before adding it as a dependency.

Reviewers: aganea, smeenai

Reviewed By: aganea

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358226 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 21:05:15 +00:00
Martin Storsjo 9093551832 [CMake] Fix accidentally swapped input/output parameters of string(REPLACE) for mingw
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357979 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 08:31:25 +00:00
Justin Bogner b935402f9a [CMake] Move configuration of LLVM_CXX_STD to HandleLLVMOptions.cmake
Standalone builds of projects other than llvm itself (lldb, libcxx,
etc) include HandleLLVMOptions but not the top level llvm CMakeLists,
so we need to set this variable here to ensure that it always has a
value.

This should fix the build issues some folks have been seeing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357976 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 08:14:32 +00:00
Justin Bogner 9736ffc02a [CMake] Replace LLVM_ENABLE_CXX1Y and friends with LLVM_CXX_STD
Simplify building with particular C++ standards by replacing the
specific "enable standard X" flags with a flag that allows specifying
the standard you want directly.

We preserve compatibility with the existing flags so that anyone with
those flags in existing caches won't break mysteriously.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357899 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 10:19:17 +00:00
Michal Gorny e259a4d243 [llvm] [cmake] Add additional headers only if they exist
Modify the add_header_files_for_glob() function to only add files
that do exist, rather than all matches of the glob.  This fixes CMake
error when one of the include directories (which happen to include
/usr/include) contain broken symlinks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357701 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 14:21:38 +00:00
Shoaib Meenai f66e62013a [cmake] Add function for building native tool
Instead of duplicating functionality for building native versions of
tblgen and llvm-config, add a function to set up a native tool build.
This will also be used for llvm-nm in a follow-up.

This should be NFC for tblgen, besides the slightly different COMMENT
for the custom command (it'll display the tablegen target name instead
of always saying TableGen).  For the native llvm-config, it's a behavior
change in that we'll use llvm_ExternalProject_BuildCmd instead of
constructing the build command manually, always build in Release, and
reference the correct binary path for multi-config generators. I believe
all of these changes to be bug fixes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357486 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 15:58:03 +00:00