summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* PCH: Generate sources during Compute stepCristian Adam2019-10-091-2/+0
|
* Unity build: Generate sources during Compute stepBrad King2019-10-031-1/+0
| | | | | | | | The unity build sources need to be added for all generators. Create them during `cmGlobalGenerator::Compute` to avoid duplicating the calls in every generator. We already handle Qt autogen there too. Issue: #19789
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-1/+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.
* Merge topic 'cuda_resolve_device_symbols_on_static_lib_collect_deps_properly'Brad King2019-09-091-13/+10
|\ | | | | | | | | | | | | 2d7bb13da7 CUDA: static lib device linking computes required static libs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3748
| * CUDA: static lib device linking computes required static libsRobert Maynard2019-09-051-13/+10
| | | | | | | | | | | | Previously the CMake didn't compute the required set of libraries needed to properly device link a static library when CUDA_RESOLVE_DEVICE_SYMBOLS was enabled.
* | Unity build: Add support for Ninja and Makefile generatorsCristian Adam2019-08-291-0/+1
|/
* Precompile headers: Add methods to generate PCH sourcesCristian Adam2019-08-281-0/+2
| | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-42/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* avoid adding multiple consecutive string literals to std::stringRolf Eike Beer2019-08-181-7/+6
| | | | While at it change some single character additions to be of type char.
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-5/+5
|
* Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-1/+1
|
* clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-2/+3
| | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-1/+2
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* CUDA: Do not device link if CUDA is not an enabled languageRobert Maynard2019-07-011-5/+3
| | | | | | | | | | | | | Checks added in commit 81b4d10d8f (CUDA: More exhaustive checks to determine when to do device linking, 2019-05-09, v3.15.0-rc1~82^2) assumed that CUDA properties would be set only if CUDA is enabled. We cannot do a device link step if we do not have the CUDA language enabled. This was discovered as some projects unconditionally set CUDA properties such as `CUDA_RESOLVE_DEVICE_SYMBOLS` even when the CUDA language has not been enabled. Fixes: #19432
* Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-4/+4
|
* CUDA: More exhaustive checks to determine when to do device linkingRobert Maynard2019-05-211-41/+10
| | | | | | | | | Previously CMake used fairly naive logic to determine when to do device linking which caused unnecessary device linking to occur frequently. We now use a more exhaustive algorithm to determine when we have a need for device linking. Fixes: #19238
* Makefiles: Sort clean files by using a std::set<std::string> containerSebastian Holtermann2019-05-141-14/+13
| | | | | | | By using a `std::set<std::string>` container instead of a `std::vector<std::string>` container, the clean files list becomes sorted and unique. The clean target in Makefiles beomes nicer and better readable this way. Also double clean entries won't appear anymore.
* Ninja,Makefile: use `unique_ptr` for memory managementSaleem Abdulrasool2019-04-181-5/+4
| | | | | Use a `unique_ptr` to manage the lifetime of the `MacOSXContentGenerator` and 'OSXBundleGenerator` rather than manually handling the lifetime.
* cmSystemTools::Error: consolidate parameters into single std::stringVitaly Stakhovsky2019-02-201-2/+2
|
* Create and use `cmGeneratorTarget::Names`Saleem Abdulrasool2019-02-111-26/+23
| | | | | | Rather than taking a number of out parameters for the various names, create a structure that is reused for both `GetLibraryNames` and `GetExecutableNames`. Replace uses according to the new interface.
* CUDA: Honor CUDA_RESOLVE_DEVICE_SYMBOLS for more target typesRobert Maynard2019-02-051-5/+18
| | | | | | | `CUDA_RESOLVE_DEVICE_SYMBOLS` can be used with shared, module, and executable target types. This relaxation is to allow for better interoperability with linkers that automatically do CUDA device symbol resolution and have no way to disable it.
* cmake: inlined files dir constant and removed it from cmake.hBruno Manganelli2019-01-211-2/+1
|
* IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-0/+1
| | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* Merge topic 'lg-directory'Brad King2018-08-281-1/+1
|\ | | | | | | | | | | | | 50fbfee3a0 cmLocalGenerator: return directories as const std::string& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2309
| * cmLocalGenerator: return directories as const std::string&Vitaly Stakhovsky2018-08-271-1/+1
| |
* | static library: add property STATIC_LIBRARY_OPTIONSMarc Chevrier2018-08-151-1/+1
|/ | | | issue: #18251
* LINK_DEPENDS: add support for property INTERFACE_LINK_DEPENDSMarc Chevrier2018-06-271-11/+11
| | | | Fixes: #17997
* LINK_OPTIONS: Add new family of propertiesMarc Chevrier2018-06-061-4/+4
| | | | | | | | | | | | | | This family enable to manage link flags Three new properties: * directory property: LINK_OPTIONS * target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS Two new commands * add_link_options(): to populate directory property * target_link_options(): to populate target properties Fixes: #16543
* Makefile generator: link flags management refactoringMarc Chevrier2018-06-061-34/+8
|
* Makefile: Fix command line limits for static libsViktor Mukha2018-05-161-4/+9
| | | | | | | | | | | | | | I have been hitting the Windows command-line limit when cross-compiling static library (POCO) and having more than 8000 characters in the call to "ar". Calculating exact limits here are tricky, since this particular limit will only take into account object file strings, which is correct for response files, but not for the archive rules (link.txt files), since they also contain the call to "ar" and its arguments. Also, there can be other additional arguments if "ar" tool is wrapped into something else, so it is a good idea to leave more space than trying to exactly fit the limit. Since response files use half of the limit as a heuristic, we reproduce it here for consistency.
* cmGeneratorTarget: Make import library checks config-awareMichael Stürmer2018-04-051-2/+2
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-5/+5
| | | | | | | | | | * 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-5/+5
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Makefiles: Drop 'requires' step and its supporting infrastructureYurii Batrak2017-12-141-3/+0
| | | | | | | | The 'requires' step was used to provide implicit dependencies between the generated Fortran module files and a Fortran target that needs these module files to ensure the correct compilation order. After recent refactoring to resolve all dependencies explicitly through `.mod.stamp` make targets, the separate 'requires' step is not needed anymore.
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-7/+7
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Merge topic 'refactor-iwyu-code'Brad King2017-09-151-1/+1
|\ | | | | | | | | | | | | 3bbe95f5 Clean up iwyu code to not be one big if statement. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1247
| * Clean up iwyu code to not be one big if statement.Bill Hoffman2017-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | This commit changes the internal -E__run_iwyu to be -E__run_co_compile. This is used for co-compile commands. These are tools that want to mirror the compiler. For each compiler invocation the tool will be invoked first. This started as a way to implement include what you use (iwyu), but has expanded to include cpplint, cppcheck and others. Likely there will be more in the future as well. This commit implements each one in its own function and provides a way to add additional ones in the future with less work.
* | Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-22/+14
|/ | | | | | 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-3/+3
|
* IPO: Consider support for each language separatelyBrad King2017-06-141-3/+3
| | | | | | | | | We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and Fortran languages. Do not try to enable support for other languages. Furthermore, each language builds with a different compiler, so check for support by CMake and the compiler for each language independently. Fixes: #16944
* cmLocalGenerator: Add a hook for compiler flags used at link timeBrad King2017-05-011-4/+4
| | | | | | | | | | | | When using a compiler to drive linking we add compiler flags from `CMAKE_<LANG>_FLAGS` in case they affect the way the compiler invokes the linker, but we don't add flags from other places that are meant only for compiling sources. Rather than calling the `AddLanguageFlags` method (which is used to add flags for compiling sources) directly, add an intermediate method that is used when adding the flags for linking. This will give us a way to add language-specific compiler flags needed when driving the linker in the same place on the command line as other compiler flags go.
* Clang IPO (LTO) supportRuslan Baratov2017-04-281-0/+2
|
* Inline and remove AddFeatureFlags methodBrad King2017-04-271-4/+6
| | | | | The method implementation is now only one call of another method, so inline it at call sites and remove it.
* CUDA: Static libraries can now explicitly resolve device symbolsRobert Maynard2017-04-261-0/+28
| | | | | | | If a static library has the property CUDA_RESOLVE_DEVICE_SYMBOLS enabled it will now perform the device link step. The normal behavior is to delay calling device link until the static library is consumed by a shared library or an executable.
* CUDA: Makefile uses relative path for device linking status messagesRobert Maynard2017-04-261-2/+6
|
* Replace boolean `implib` parameters with enumGregor Jasny2017-04-201-1/+2
| | | | | Named enumeration values are much clearer at call sites and add more type safety.
* Implement interprocedural optimization for GNU compilersRuslan Baratov2017-03-301-7/+14
| | | | | Honor the `INTERPROCEDURAL_OPTIMIZATION` target property for GNU compilers by activating their link-time-optimization (LTO) flags.