summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-6/+6
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* Merge topic 'fileapiLinkPathAndLinkDirBacktraces'Brad King2019-09-201-0/+35
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 4d6334824d fileapi: add backtraces for LINK_PATH and LINK_DIRECTORIES 5bd65dff7a cmLocalGenerator: Add OutputLinkLibraries overload with backtraces 5d39e792ae cmGeneratorTarget: Store backtrace for target LINK_DIRECTORIES property 7da17ef797 cmLinkLineComputer: Add ComputeLinkLibraries overload with backtraces d4d0dd0f6a cmLinkLineComputer: Add ComputeLinkLibs overload with backtraces 0ac9dcb807 cmLinkLineComputer: Add ComputeLinkPath overload with backtraces 0c6468178a cmComputeLinkInformation: Add GetDirectoriesWithBacktraces a209b31d0d cmComputeLinkInformation: Add AppendValues with backtraces Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3805
| * cmComputeLinkInformation: Add GetDirectoriesWithBacktracesJustin Goshi2019-09-181-0/+22
| |
| * cmComputeLinkInformation: Add AppendValues with backtracesJustin Goshi2019-09-181-0/+13
| |
* | clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-2/+2
| |
* | clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-2/+1
|/ | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* Add per-lang variants of CMAKE_LINK_LIBRARY_{FILE_FLAG,SUFFIX}Alan W. Irwin2019-08-271-4/+14
| | | | | | | | | | Extend the change from commit 689be6235e (Generator: support per-language link library flag, 2019-08-08) to cover more link library command-line flag components. Allow compilers for different languages to use different values for these linking-related variables within the same build. Closes: #19631
* Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-10/+5
| | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-63/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* Merge topic 'cm-contains'Brad King2019-08-211-6/+7
|\ | | | | | | | | | | | | | | | | 2dfc52675c cmAlgorithms: Add cmContains Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !3700
| * cmAlgorithms: Add cmContainsRegina Pfeifer2019-08-191-6/+7
| | | | | | | | Also, use the new function where applicable.
* | Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-2/+2
|/ | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-11/+11
|
* Generator: support per-language link library flagSaleem Abdulrasool2019-08-091-2/+7
| | | | | | | | This enables the use of MSVC and Swift on Windows in a single project. MSVC uses no flag to indicate linked libraries while Swift uses `-l`. Add support for a language specific link library flag which takes precedence over the global `CMAKE_LINK_LIBRARY_FLAG` which preserves compatibility with earlier releases.
* clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-1/+1
| | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* Make CMAKE_LINK_LIBRARY_FILE_FLAG work like CMAKE_LINK_LIBRARY_FLAGBrad King2019-08-021-10/+0
| | | | | | | | | | | | | | | | | | The `CMAKE_LINK_LIBRARY_FILE_FLAG` variable is meant for linkers that want library file paths to be preceded by a flag. This is used only for OpenWatcom to add the `library` argument before library file paths. Refactor the approach to treat `CMAKE_LINK_LIBRARY_FILE_FLAG` as a command-line string fragment to add just before the library file path. This has two advantages: * `CMAKE_LINK_LIBRARY_FILE_FLAG` now works like `CMAKE_LINK_LIBRARY_FLAG`. * `CMAKE_LINK_LIBRARY_FILE_FLAG` can now be an attached flag whose value is the library file path. Technically this is a change in behavior, but this setting was created for internal use and should be rarely used outside of CMake itself. Fixes: #19541
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-1/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* AIX: Create import library for executables with exportsBrad King2019-07-161-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On AIX, plugins meant to be loaded into executables via `dlopen` must be linked with access to a list of symbols exported from the executable in order to use them (when not using runtime linking). The AIX linker supports specifying this list as an "import file" passed on the command line either via the `-bI:...` option or (with a leading `#! .` line) as a normal input file like any other library file. The linker import file plays the same role on AIX as import libraries do on Windows. Teach CMake to enable its import library abstraction on AIX for executables with the `ENABLE_EXPORTS` target property set. Teach our internal `ExportImportList` script to optionally generate a leading `#! .` line at the top of the generated export/import list. Update our rule for linking an executable with exports to generate a public-facing "import library" implemented as an AIX linker import file. With this approach, our existing infrastructure for handling import libraries on Windows will now work for AIX linker import files too: * Plugins that link to their executable's symbols will be automatically linked using the import file on the command line. * The executable's import file will be (optionally) installed and exported for use in linking externally-built plugins. This will allow executables and their plugins to build even if we later turn off runtime linking. Issue: #19163
* Refactor checks for whether a target has an import libraryBrad King2019-07-121-15/+6
| | | | Use `HasImportLibrary` for such checks.
* BUILD_RPATH/INSTALL_RPATH: Add generator expression supportKyle Edwards2019-06-251-5/+7
| | | | Fixes: #19423
* Merge topic 'error-consolidate'Brad King2019-02-251-2/+2
|\ | | | | | | | | | | | | 9dd255548d cmSystemTools::Error: consolidate parameters into single std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2995
| * cmSystemTools::Error: consolidate parameters into single std::stringVitaly Stakhovsky2019-02-201-2/+2
| |
* | cmSystemTools: More functions accept `std::string` paramsVitaly Stakhovsky2019-02-201-1/+1
|/
* cmSystemTools::Message: Add overload accepting std::stringVitaly Stakhovsky2019-01-281-1/+1
|
* cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-1/+1
|
* clang-tidy: Use emplaceRegina Pfeifer2019-01-171-3/+3
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-5/+6
| | | | Reduce the number of files relying on `cmake.h`.
* Remove now-unused code once used on IRIXBrad King2019-01-111-1/+1
| | | | | We dropped support for IRIX as a host platform long ago. Remove some leftover code.
* RPATH: Add option for using $ORIGIN in build treePeter Wu2018-10-261-3/+26
| | | | | | | | | This makes binaries independent of the build directory by not embedding the build directory via RPATH. The tests are partially based on the existing RuntimePath test, but with the check moved into a POST_BUILD command such that it can be skipped when the platform lacks support. Fixes: #18413
* LINK_DIRECTORIES: Add new properties and commandsMarc Chevrier2018-09-251-6/+5
| | | | | | | | | | | | These new capabilities enable to manage link directories Two new properties: * target properties: LINK_DIRECTORIES and INTERFACE_LINK_DIRECTORIES One new command * target_link_directories(): to populate target properties Fixes: #17215
* cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-1/+1
|
* Replace occurrences of "Mac OS X" with "macOS" in commentsBartosz Kosiorek2018-09-101-1/+1
| | | | | | | | Apple's main Operating system changed their name from OS X to macOS: https://www.engadget.com/2016/06/13/os-x-is-now-macos/ Revise source comments accordingly.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-7/+6
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* cmComputeLinkInformation: make some members constVitaly Stakhovsky2018-03-221-20/+20
|
* cmComputeLinkInformation: make GetItems() constMichael Stürmer2018-03-191-1/+1
|
* objlib: Allow other libraries to link to `OBJECT` libraries.Deniz Bahadir2018-03-011-0/+3
| | | | | | | | Note: This only allows `OBJECT` libraries to be on the right-hand side of `target_link_libraries` but still does not link its object-files to the target on the left-hand side. Issue: #14778
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-5/+6
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-17/+17
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* cmComputeLinkInformation: Better RPATH detection for versioned libraries.Byoungchan Lee2018-01-221-5/+3
| | | | | | | | | | | Some libraries uses the non-conventional SONAME scheme like `libssl.so.1.1` or `libboost_system.so.1.64.0`, but CMake didn't count on such versioned libraries. This commit modify regular expressions to match relaxed format of shared library name for determining various linker options, especially `RPATH`. Note that support for one component has been available since v2.8.12. Fixes: #15938
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-1/+1
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-67/+44
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-10/+10
|
* Access string npos without instancePavel Solodovnikov2017-06-011-2/+2
|
* Add options for separate compile and link sysrootsBrad King2017-05-091-1/+7
| | | | | | | | | Add `CMAKE_SYSROOT_COMPILE` and `CMAKE_SYSROOT_LINK` variables to as operation-specific alternatives to `CMAKE_SYSROOT`. This will be useful for Android NDKs that compile and link with different sysroot values (e.g. `r14` with unified headers). Co-Author: Florent Castelli <florent.castelli@gmail.com>
* Replace boolean `implib` parameters with enumGregor Jasny2017-04-201-4/+16
| | | | | Named enumeration values are much clearer at call sites and add more type safety.
* Allow imported INTERFACE libraries to specify a link library nameBrad King2016-11-091-0/+6
| | | | | | | | | | | | | | | Add an `IMPORTED_LIBNAME[_<CONFIG>]` target property to specify a library name to be placed on the link line in place of an interface library since it has no library file of its own. Restrict use of the property to imported `INTERFACE` libraries. This will be particularly useful for find modules that need to provide imported libraries from system SDKs where the full path to the library file is not known. Now such find modules will be able to provide an imported interface library and set `IMPORTED_LIBNAME` to refer to the SDK library by name. Issue: #15267
* cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | Include it in dependents which have previously relied on it transitively.
* cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
|
* cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-22/+23
|
* Add a BUILD_RPATH target property specifying build-tree RPATH entriesRuslan Baratov2016-10-031-0/+6
| | | | | | Users may need to add custom `RPATH` entries to be able to run binaries from their build tree without setting `LD_LIBRARY_PATH`. Provide a way to do this that does not affect the install-tree `RPATH`.