llvm-project/llvm/utils/gn/build
Nico Weber fee435702d 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

llvm-svn: 357574
2019-04-03 12:33:19 +00:00
..
libs gn build: Add some build files for clangd 2019-03-28 16:53:32 +00:00
toolchain gn build: Add build files for clangd xpc framework code 2019-04-03 12:33:19 +00:00
BUILD.gn [gn] Add target flags to asmflags. 2019-02-21 20:35:31 +00:00
BUILDCONFIG.gn gn build: Create regular archives for the sanitizer runtimes. 2019-02-01 20:34:43 +00:00
buildflags.gni [gn build] Separate debug and optimization settings 2019-02-12 22:24:45 +00:00
fuzzer.gni [gn build] Add fuzzers in llvm/tools that are needed for check-llvm 2019-01-02 18:13:14 +00:00
mac_sdk.gni
run_tablegen.py [gn build] Set +x bit on .py files in llvm/utils/gn/build. 2018-11-29 22:56:40 +00:00
symlink_or_copy.gni [gn build] Add infrastructure to create symlinks and use it to create lld's symlinks 2018-12-14 00:16:33 +00:00
symlink_or_copy.py gn build: Add build files for clangd xpc framework code 2019-04-03 12:33:19 +00:00
sync_source_lists_from_cmake.py gn build: Add build files for non-framework xpc clangd bits 2019-04-02 14:39:34 +00:00
write_cmake_config.gni gn build: s/root_out_dir/root_build_dir/g in llvm/utils/gn/build/write_cmake_config.gni. 2019-01-11 19:51:49 +00:00
write_cmake_config.py Make the write_cmake_config.py script python3-compatible 2019-01-09 10:49:44 +00:00
write_vcsrevision.py gn build: Fix Python 3 write_vcsrevision script compatibility 2019-02-05 13:01:12 +00:00