llvm.org GIT mirror llvm / fbb50d9
[tools] Add option to install binutils symlinks The LLVM tools can be used as a replacement for binutils, in which case it's convenient to create symlinks with the binutils names. Add support for these symlinks in the build system. As with any other llvm tool symlinks, the user can limit the installed symlinks by only adding the desired ones to `LLVM_TOOLCHAIN_TOOLS`. Differential Revision: https://reviews.llvm.org/D39530 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317272 91177308-0d34-0410-b5e6-96231b3b80d8 Shoaib Meenai 1 year, 9 months ago
12 changed file(s) with 48 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
177177 # Generate a CompilationDatabase (compile_commands.json file) for our build,
178178 # for use by clang_complete, YouCompleteMe, etc.
179179 set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
180
181 option(LLVM_INSTALL_BINUTILS_SYMLINKS
182 "Install symlinks from the binutils tool names to the corresponding LLVM tools." OFF)
180183
181184 option(LLVM_INSTALL_UTILS "Include utility binaries in the 'install' target." OFF)
182185
222222 **LLVM_INCLUDE_TOOLS**:BOOL
223223 Generate build targets for the LLVM tools. Defaults to ON. You can use this
224224 option to disable the generation of build targets for the LLVM tools.
225
226 **LLVM_INSTALL_BINUTILS_SYMLINKS**:BOOL
227 Install symlinks from the binutils tool names to the corresponding LLVM tools.
228 For example, ar will be symlinked to llvm-ar.
225229
226230 **LLVM_BUILD_EXAMPLES**:BOOL
227231 Build LLVM examples. Defaults to OFF. Targets for building each example are
1616 add_llvm_tool_symlink(llvm-ranlib llvm-ar)
1717 add_llvm_tool_symlink(llvm-lib llvm-ar)
1818 add_llvm_tool_symlink(llvm-dlltool llvm-ar)
19
20 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
21 add_llvm_tool_symlink(ar llvm-ar)
22 add_llvm_tool_symlink(dlltool llvm-ar)
23 add_llvm_tool_symlink(ranlib llvm-ar)
24 endif()
55 add_llvm_tool(llvm-cxxfilt
66 llvm-cxxfilt.cpp
77 )
8
9 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
10 add_llvm_tool_symlink(c++filt llvm-cxxfilt)
11 endif()
1414 DEPENDS
1515 intrinsics_gen
1616 )
17
18 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
19 add_llvm_tool_symlink(dwp llvm-dwp)
20 endif()
1313 DEPENDS
1414 intrinsics_gen
1515 )
16
17 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
18 add_llvm_tool_symlink(nm llvm-nm)
19 endif()
66 llvm-objcopy.cpp
77 Object.cpp
88 )
9
10 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
11 add_llvm_tool_symlink(objcopy llvm-objcopy)
12 endif()
2424 if(HAVE_LIBXAR)
2525 target_link_libraries(llvm-objdump ${XAR_LIB})
2626 endif()
27
28 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
29 add_llvm_tool_symlink(objdump llvm-objdump)
30 endif()
2222 )
2323
2424 add_llvm_tool_symlink(llvm-readelf llvm-readobj)
25
26 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
27 add_llvm_tool_symlink(readelf llvm-readobj)
28 endif()
55 add_llvm_tool(llvm-size
66 llvm-size.cpp
77 )
8
9 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
10 add_llvm_tool_symlink(size llvm-size)
11 endif()
77 llvm-strings.cpp
88 )
99
10 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
11 add_llvm_tool_symlink(strings llvm-strings)
12 endif()
1313 add_llvm_tool(llvm-symbolizer
1414 llvm-symbolizer.cpp
1515 )
16
17 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
18 add_llvm_tool_symlink(addr2line llvm-symbolizer)
19 endif()