Commit Graph

275 Commits

Author SHA1 Message Date
Nico Weber 396f459f95 gn build: Fix Windows builds after r357797
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358004 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 14:02:02 +00:00
Nico Weber e51a6f1706 gn build: Merge r357905
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357907 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 12:43:46 +00:00
Nico Weber 070c4bb390 gn-build: Re-run git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357906 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 12:42:37 +00:00
Petr Hosek 003add3c66 [gn] Support for per-target runtime directory layout
This change also introduces the clang_enable_per_target_runtime_dir
to enable the use of per-target runtime directory layout which is the
equivalent of LLVM_ENABLE_PER_TARGET_RUNTIME_DIR CMake option.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357850 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-06 23:05:56 +00:00
Nico Weber f3c71e3d75 gn build: Pacify gn format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357830 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 23:57:10 +00:00
Petr Hosek a47974f1b9 [gn] Support for building compiler-rt builtins
This is support for building compiler-rt builtins, The library build
should be complete for a subset of supported platforms, but not all
CMake options have been replicated in GN.

We always use the just built compiler to build all the runtimes, which
is equivalent to the CMake runtimes build. This simplifies the build
configuration because we don't need to support arbitrary host compiler
and can always assume the latest Clang. With GN's toolchain support,
this is significantly more efficient than the CMake runtimes build.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357821 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 21:30:40 +00:00
Petr Hosek 4fb52f8a32 [gn] Rebase paths in symlink_or_copy against root_build_dir
We should be always rebasing paths against root_build_dir which is
the directory where scripts are run from, not root_out_dir which is
the current toolchain directory. The latter can result in invalid
paths when the action is being used from a non-default toolchain.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357798 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 19:13:54 +00:00
Petr Hosek ff27e9f183 [gn] Make -no-exceptions flag a config
This allows it to be disabled for targets that need exceptions
like libunwind, libc++abi and libc++.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357797 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 19:12:37 +00:00
Nico Weber 226c868c6a gn build: Merge 357768 and 357770
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357783 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 17:05:54 +00:00
Nico Weber 5f868076d7 gn build: Merge r357719
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357781 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 16:57:34 +00:00
Nico Weber 0d753d008e gn build: Merge r357663
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357666 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 02:08:10 +00:00
Reid Kleckner fe2046590d [gn] Use "$link /lib" for archives instead of lib.exe
Summary:
This avoids the need to talk about lib.exe or llvm-lib.exe and it does
the right thing with LLD.

Reviewers: thakis

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357660 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 00:31:19 +00:00
Nico Weber 5c7b7d7261 gn build: Add build file for dexp
None of check-clang-tools's tests run this, but the CMake
check-clang-tools depends on the binary, so add it for consistency.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357624 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 19:09:15 +00:00
Nico Weber 8878856e8f gn build: Add build files for clangd xpc framework code
This is a bit of a larger change since this is the first (and as far as
I can tell only) place where the LLVM build produces macOS framework
bundles.

GN has some built-in support for this, so use that.
`gn help create_bundle` has a terse description (but it's a bit
outdated: `deps` must be `public_deps` and the conditionals in the
example in the help aren't quite right on non-iOS).

We need a new 'copy_bundle_data' tool, and since we copy the clangd.xpc
bundle as bundle_data into ClangdXPC.framework it needs to be able to
handle directories in addition to files.

GN also insists we have a compile_xcassets tool even though it's not
used. I just made that run `false`.

Despite GN's support for bundles, we still need to manually create the
expected symlink structure in the .framework bundle. Since this code
never runs on Windows, it's safe to create the symlinks before the
symlink targets exist, so we can just make the bundle depend on the
steps that create the symlinks. For this to work, change the symlink
script to create the symlink's containing directory if it doesn't yet
exist.

I locally verified that CMake and GN build create the same bundle
structure. (I noticed that both builds set LC_ID_DYLIB to the pre-copy
libClangdXPCLib.dylib name, but that seems to not cause any issues and
it happens in the CMake build too.)

(Also add an error message to clangd-xpc-test-client for when loading
the dylib fails – this was useful while locally debugging this.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357574 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 12:33:19 +00:00
Nico Weber 73c045c7be gn build: Merge r357469
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357477 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 14:44:34 +00:00
Nico Weber e3e62b426c gn build: Add build files for non-framework xpc clangd bits
Differential Revision: https://reviews.llvm.org/D60124

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357476 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 14:39:34 +00:00
Nico Weber a7bc052cae gn build: Merge r357383
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357398 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-01 14:59:50 +00:00
Nico Weber a11754154d gn build: Add build files for most clang-tools-extra unit tests
Differential Revision: https://reviews.llvm.org/D60038

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357369 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-31 16:49:54 +00:00
Nico Weber 561ba97829 gn build: Merge r357340
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357358 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-31 00:03:37 +00:00
Nico Weber 911aef5e01 gn build: Merge r357326
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357357 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-31 00:01:24 +00:00
Nico Weber 755ffc48b1 gn build: Merge r357248
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357261 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 14:31:28 +00:00
Nico Weber b44e4a67c7 gn build: Merge r357259
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357260 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 14:30:01 +00:00
Nico Weber 56e8d40dd0 gn build: Add check-clang-tools to run clang-tools-extra lit tests
Only runs the clang-tools-extra lit tests; not yet the unit tests.

Add a build file for clangd-indexer too, since it's needed for
the tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357232 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 02:49:13 +00:00
Nico Weber 5c4309d454 gn build: Add some build files for clangd
Enough to build the clangd binaries, but this is still missing build
files for:
- fuzzer
- indexer
- index/dex/dexp
- benchmarks
- xpc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357182 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 16:53:32 +00:00
Nico Weber b23265474e gn build: Merge r357047
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357071 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-27 15:10:47 +00:00
Nico Weber 7b01616565 gn build: Add build files for clang-include-fixer and find-all-symbols
Differential Revision: https://reviews.llvm.org/D59838

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357042 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-27 00:17:05 +00:00
Nico Weber f50526b270 gn build: Format all build files
Re-ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357021 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 19:16:28 +00:00
Nico Weber 10ee5d422d gn build: Merge r356929 (effectively relands r353518, reverted in r353621)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357019 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 18:55:37 +00:00
Alexander Kornienko f694319233 [clang-tidy] Separate the check-facing interface
Summary:
Move ClangTidyCheck to a separate header/.cpp
Switch checks to #include "ClangTidyCheck.h"
Mention ClangTidyCheck.h in the docs

Reviewers: hokein, gribozavr, aaron.ballman

Reviewed By: hokein

Subscribers: mgorny, javed.absar, xazax.hun, arphaman, jdoerfert, llvm-commits, cfe-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356890 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 12:36:30 +00:00
Nico Weber a0a20fdec3 gn build: Clean up README.rst a bit
- Make introduction a bit shorter
- Add a `git clone` step to Quick start
- Put command to run first in each of the Quick start steps
- Use ``code`` instead of `label` throughout; this is .rst not .md

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356885 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 11:33:19 +00:00
Nico Weber af179cc68e gn build: Let get.py keep zip file in memory instead of using a temp file
The zip is small, and it's a bit less code this way.
No intended behavior change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356884 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 11:32:27 +00:00
Nico Weber 5646c0a792 gn build: Merge r356820
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356846 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-23 23:22:45 +00:00
Nico Weber 025a2dcaff gn build: Add build files for modularize and pp-trace
Differential Revision: https://reviews.llvm.org/D59701

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356845 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-23 23:16:41 +00:00
Vitaly Buka 1fb71691ed [gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356828 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-23 02:31:23 +00:00
Vitaly Buka 82921a136c [gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356827 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-23 02:20:48 +00:00
Nico Weber b884c5db34 Make clang-move use same file naming convention as other tools
In all the other clang-foo tools, the main library file is called
Foo.cpp and the file in the tool/ folder is called ClangFoo.cpp.
Do this for clang-move too.

No intended behavior change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356780 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 16:34:39 +00:00
Nico Weber d6235de033 gn build: Merge r356750
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356772 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 16:00:16 +00:00
Nico Weber cda5303cf2 gn build: Merge r356570
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356771 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 15:58:33 +00:00
Nico Weber bf41b04739 gn build: Merge r356662
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356770 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 15:56:33 +00:00
Nico Weber bb7534533b gn build: Merge r356692
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356769 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 15:54:29 +00:00
Nico Weber 6e1d5e79bc gn build: Merge r356753
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356767 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 15:50:24 +00:00
Nico Weber 2943ef684f gn build: Merge r356652 (and follow-up r56655)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356766 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 15:48:11 +00:00
Nico Weber abfc7b0758 gn build: Merge r356729
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356765 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 15:43:06 +00:00
Nico Weber b0941775f0 Remove HAVE_REALPATH from config.h
Its last use was removed in r352916.
No behavior change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356579 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 17:26:11 +00:00
Nico Weber b8014cec30 gn build: Add build files for some clang-tools-extra
Adds clang-change-namespace, clang-move, clang-query,
clang-reorder-fields.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356567 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 16:14:16 +00:00
Nico Weber 6c730c69df gn build: Merge r356508
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356563 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 15:41:25 +00:00
Nico Weber 0e7dac6a2f gn build: Merge r356519
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356560 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 15:36:11 +00:00
Peter Collingbourne 861cde1460 gn build: Merge r356387.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356485 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 17:30:59 +00:00
Peter Collingbourne 57757dd059 gn build: Merge r356451.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356484 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 17:30:50 +00:00
Peter Collingbourne c9ba0947cd gn build: Merge r356305.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356314 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-16 03:46:02 +00:00