[PATCH] D56330: [gn build] Add build files for unittests that load shared libraries

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 13:05:03 PST 2019


thakis created this revision.
thakis added a reviewer: phosek.

This is slightly ugly for three reasons:

- The shlib needs to go next to the binary to be found on all platforms, so the build files refer to target_out_dir
- The explicit -fPIC flag needed on the shared lib side, and the -rdynamic flag needed on the host side, on Linux
- Plugins that refer to LLVM code and assume that the host will resolve them don't work on Windows -- PluginsTests won't test anything on Windows (but DynamicLibraryTests will, since the dll here doesn't call LLVM code)

If we get lots more of these plugin / plugin host targets, it might make sense to add a template for them. But for now, these are the last ones we need. (We're at 6 plugin hosts, 2 of them tests, and at 6 shared libraries, 2 of them tests as well. clang is a plugin host by default in the CMake build but not (yet?) in the GN build.)


https://reviews.llvm.org/D56330

Files:
  llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
  llvm/utils/gn/secondary/llvm/unittests/Passes/BUILD.gn
  llvm/utils/gn/secondary/llvm/unittests/Support/DynamicLibrary/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56330.180307.patch
Type: text/x-patch
Size: 3934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190104/b00b24db/attachment.bin>


More information about the llvm-commits mailing list