1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/tools
Shoaib Meenai d81bfe1cb8 [CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.

Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.

Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).

Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.

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

llvm-svn: 319840
2017-12-05 21:49:56 +00:00
..
bugpoint [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
bugpoint-passes
dsymutil [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
gold Rename CommandFlags.h -> CommandFlags.def 2017-11-27 19:43:58 +00:00
llc Rename CommandFlags.h -> CommandFlags.def 2017-11-27 19:43:58 +00:00
lli Rename CommandFlags.h -> CommandFlags.def 2017-11-27 19:43:58 +00:00
llvm-ar [llvm-ar] Support an options string that start with a dash 2017-11-03 20:09:10 +00:00
llvm-as Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
llvm-as-fuzzer cmake: Invent add_llvm_fuzzer to set up fuzzer targets 2017-08-31 00:36:33 +00:00
llvm-bcanalyzer Bitcode: Include any strings added to the string table in the module hash. 2017-07-06 17:56:01 +00:00
llvm-c-test [LLVM-C] Expose functions to create debug locations via DIBuilder. 2017-11-01 22:18:52 +00:00
llvm-cat [Bitcode] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-09-07 23:28:24 +00:00
llvm-cfi-verify [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
llvm-config [GlobalISel] Make GlobalISel a non-optional library. 2017-08-03 21:52:25 +00:00
llvm-cov [llvm-cov] Don't render empty region marker lines 2017-11-09 02:33:44 +00:00
llvm-cvtres [llvm-cvtres] Add support for ARM64 2017-11-10 22:27:41 +00:00
llvm-cxxdump Add llvm::for_each as a range-based extensions to <algorithm> and make use of it in some cases where it is a more clear alternative to std::for_each. 2017-11-03 20:01:25 +00:00
llvm-cxxfilt Add opt-viewer testing 2017-11-29 17:07:41 +00:00
llvm-demangle-fuzzer llvm-demangle-fuzzer: Link in Support 2017-11-17 20:46:55 +00:00
llvm-diff
llvm-dis [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-dwarfdump llvm-dwarfdump: honor the --show-children option when dumping a specific DIE. 2017-11-29 01:12:22 +00:00
llvm-dwp Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables 2017-11-27 19:55:16 +00:00
llvm-extract [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-go Update some code.google.com links 2017-11-13 23:47:58 +00:00
llvm-isel-fuzzer Rename CommandFlags.h -> CommandFlags.def 2017-11-27 19:43:58 +00:00
llvm-jitlistener
llvm-link [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-lto Rename CommandFlags.h -> CommandFlags.def 2017-11-27 19:43:58 +00:00
llvm-lto2 Rename CommandFlags.h -> CommandFlags.def 2017-11-27 19:43:58 +00:00
llvm-mc Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables 2017-11-27 19:55:16 +00:00
llvm-mc-assemble-fuzzer Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables 2017-11-27 19:55:16 +00:00
llvm-mc-disassemble-fuzzer cmake: Invent add_llvm_fuzzer to set up fuzzer targets 2017-08-31 00:36:33 +00:00
llvm-mcmarkup Add llvm::for_each as a range-based extensions to <algorithm> and make use of it in some cases where it is a more clear alternative to std::for_each. 2017-11-03 20:01:25 +00:00
llvm-modextract [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-mt Don't #include MemoryBuffer.h from Host.h. 2017-11-17 01:00:35 +00:00
llvm-nm Add llvm::for_each as a range-based extensions to <algorithm> and make use of it in some cases where it is a more clear alternative to std::for_each. 2017-11-03 20:01:25 +00:00
llvm-objcopy [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
llvm-objdump [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
llvm-opt-fuzzer Rename CommandFlags.h -> CommandFlags.def 2017-11-27 19:43:58 +00:00
llvm-opt-report Don't call exit from cl::PrintHelpMessage. 2017-09-07 23:30:48 +00:00
llvm-pdbutil Split TypeTableBuilder into two classes. 2017-11-30 18:39:50 +00:00
llvm-profdata [llvm-profdata] Don't treat non-fatal merge errors as fatal 2017-11-17 21:18:32 +00:00
llvm-rc llvm-rc/ResourceScriptTokenList.h: Turns this into a .def file to imply that it's non-modular 2017-11-21 00:23:19 +00:00
llvm-readobj [llvm-readobj] Remove redundant local variables to reduce the code. NFC 2017-12-02 13:06:40 +00:00
llvm-rtdyld [Support] Support NetBSD PaX MPROTECT in sys::Memory. 2017-11-16 23:04:44 +00:00
llvm-shlib [Solaris] enable --whole-archive for shared-library build, disable --version-script for Solaris-ld 2017-07-19 16:07:51 +00:00
llvm-size Add llvm::for_each as a range-based extensions to <algorithm> and make use of it in some cases where it is a more clear alternative to std::for_each. 2017-11-03 20:01:25 +00:00
llvm-special-case-list-fuzzer [llvm-special-case-list-fuzzer] Add fuzz target. 2017-10-17 17:43:34 +00:00
llvm-split [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-stress [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-strings [llvm-strings] Add support for the -a/--all options 2017-11-14 19:58:36 +00:00
llvm-symbolizer [tools] Add option to install binutils symlinks 2017-11-02 21:43:32 +00:00
llvm-xray xray-record-yaml.h: Remove unused file 2017-11-21 00:33:17 +00:00
lto Rename CommandFlags.h -> CommandFlags.def 2017-11-27 19:43:58 +00:00
msbuild
obj2yaml Add ELF dynamic symbol support to yaml2obj/obj2yaml 2017-11-16 18:10:15 +00:00
opt [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
opt-viewer Add opt-viewer testing 2017-11-29 17:07:41 +00:00
sancov Add section headers to SpecialCaseLists 2017-09-25 22:11:11 +00:00
sanstats Fix broken links to the Itanium CXX ABI 2017-09-12 00:19:11 +00:00
verify-uselistorder
xcode-toolchain [llvm] Add stripped installation targets 2017-11-30 21:48:26 +00:00
yaml2obj Add ELF dynamic symbol support to yaml2obj/obj2yaml 2017-11-16 18:10:15 +00:00
CMakeLists.txt
LLVMBuild.txt Introduce the llvm-cfi-verify tool (resubmission of D37937). 2017-09-20 20:38:14 +00:00