summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-2/+2
| | | | | | | | | | * 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.
* cmLocalGenerator: change ImportedGeneratorTargets from vector to mapFrank Winklmeier2018-01-301-1/+1
| | | | | | | | For large number of targets significant amount of time is spent in cmLocalGenerator::FindGeneratorTargetToUse, which uses find_if on a vector to locate the given target. Using a map instead of vector for ImportedGeneratorTargets (as done for cmMakefile::ImportedTargets) provides a significant speedup (up to factor of 2).
* cmLocalGenerator: remove public GetImportedGeneratorTargetsFrank Winklmeier2018-01-301-5/+0
| | | | | GetImportedGeneratorTargets is not used anywhere hence remove it to avoid exposing the type of ImportedGeneratorTargets.
* sourceFile properties: add property INCLUDE_DIRECTORIESMarc Chevrier2018-01-241-0/+17
|
* LocalGenerator: refactoringMarc Chevrier2018-01-231-3/+20
| | | | | Introduce method AppendCompileOptions to support future source file property COMPILE_OPTIONS.
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-3/+3
|
* Use C++11 unordered containersDaniel Pfeifer2017-08-221-2/+3
|
* Performance: Add an index to Change cmLocalGenerator::GeneratorTargets.Aaron Orenstein2017-08-161-1/+5
| | | | | | | | | | | Add an index to Change cmLocalGenerator::GeneratorTargets for faster lookup by name. Also changed a bunch of uses of cmLocalGenerator::GetGeneratorTargets() to take const references instead of copying the vector. Represent generator targets as a map (name -> target) to make name lookups more efficient instead of looping through the entire vector to find the desired one.
* Add options for separate compile and link sysrootsBrad King2017-05-091-0/+1
| | | | | | | | | 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>
* cmLocalGenerator: Add a hook for compiler flags used at link timeBrad King2017-05-011-0/+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.
* Features: Refactor <LANG>_STANDARD updateBrad King2017-05-011-0/+2
| | | | | | | | | In order to support generator expressions in target COMPILE_FEATURES we apply them at generate time. Move this step to the beginning of generation instead of doing it on demand while collecting flags. This avoids repeating the process unnecessarily, and will then allow `cmLocalGenerator::AddCompilerRequirementFlag` to be used any time during generation.
* Clang IPO (LTO) supportRuslan Baratov2017-04-281-0/+3
|
* Add IPO compiler flags more consistently in generatorsBrad King2017-04-271-2/+2
| | | | | | Move addition of IPO flags into `cmLocalGenerator::AddLanguageFlags` because all call sites of that need the IPO flags, but not all were following the call with `AppendFeatureOptions`.
* CUDA: Allow sources to be compiled to .ptx filesRobert Maynard2017-04-201-1/+2
| | | | | When the target property `CUDA_PTX_COMPILATION` is enabled CUDA OBJECT libraries will generate ptx files instead of object files.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-2/+2
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* clang-tidy: apply performance-unnecessary-value-param fixesDaniel Pfeifer2016-12-121-1/+1
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-10/+9
|
* cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
|
* cmState: Port dependent code to new cmStateSnapshot nameStephen Kelly2016-10-191-2/+2
|
* cmRulePlaceholderExpander: Port clients to direct-useStephen Kelly2016-10-151-13/+3
| | | | | | Add a factory function to cmLocalGenerator so that variableMappings can be provided from it, and so that Ninja can always have a hard-coded TargetImpLib.
* cmRulePlaceholderExpander: Extract from cmLocalGeneratorStephen Kelly2016-10-151-39/+2
| | | | | Implement cmLocalGenerator::ExpandRuleVariables in terms of the new class for source compatibility and to reduce diff noise in this commit.
* cmLocalGenerator: Move memset to cxx fileStephen Kelly2016-10-151-1/+1
|
* cmLocalGenerator: Use strings instead of a Target in rule replacementStephen Kelly2016-10-151-1/+2
| | | | Don't rely on the cmGeneratorTarget type needlessly.
* cmLocalGenerator: Use a converter in rule replacement APIStephen Kelly2016-10-151-2/+4
| | | | | | | The rule replacement API should not really be in cmLocalGenerator, but it was historically, and this coupled many other things together here too, such as output conversion. Make the output converter a parameter so that rule replacement can be removed from cmLocalGenerator.
* cmLocalGenerator: Store variable replacements as stateStephen Kelly2016-10-151-0/+4
| | | | These do not change over the lifetime of the cmLocalGenerator.
* cmLocalGenerator: Remove the launcher from RuleVariablesStephen Kelly2016-10-151-8/+7
| | | | | | | | | This one is not like the others as it doesn't participate in substitutions. Keep ExpandRuleVariables doing only one thing and make callers responsible for inserting a launcher prefix, simplifying the code all-around. Remove now-obsolete InsertRuleLauncher method.
* cmLinkLineComputer: Extract link libraries computation from cmLocalGeneratorStephen Kelly2016-10-101-2/+1
| | | | Hide some methods which no longer need to be public.
* cmLinkLineComputer: Move FrameworkPath computation from cmLocalGeneratorStephen Kelly2016-10-101-2/+2
| | | | Add UseWatcomQuote state, and remove corresponding method parameters.
* cmLinkLineComputer: Move RPath computation from cmLocalGeneratorStephen Kelly2016-10-101-2/+1
| | | | | | Add state for Relink and populate it at the point of cmLinkLineComputer initialization. This allows removal of the parameter in go-between methods.
* cmLocalGenerator: Pass link library info to OutputLinkLibrariesStephen Kelly2016-10-101-3/+5
| | | | | | | Remove the cmGeneratorTarget from the interface. This is simplification of the OutputLinkLibraries responsibilities so that it can be broken apart into multiple methods.
* cmLinkLineComputer: Extract from cmLocalGeneratorStephen Kelly2016-10-101-4/+5
| | | | | | | | | | | CMake has several classes which have too many responsibilities. cmLocalGenerator is one of them. Start to extract the link line computation. Create generator-specific implementations of the interface to account for generator-specific behavior. Unfortunately MSVC60 has different behavior to everything else and CMake still generates makefiles for it. Isolate it with MSVC60-specific names.
* Merge topic 'cleanup-Convert'Brad King2016-10-071-3/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 20e62f74 cmLocalGenerator: Simplify ConvertToLinkReference fd93b360 cmOutputConverter: Add a flag for IsUnix 1365e18b Convert: Inline platform-specific methods 1ed5f6b3 Makefiles: Introduce local RelativePath method 8377d9e0 Fortran: Inline conversion to relative path 00173b71 Fortran: Wrap path convert in a call with a more-suitable name d5911ef0 Makefiles: Hardcode the relative location of the CMakeCache file c3264f48 Convert: Extract method to determine if paths are in directory 52168f32 Convert: Remove asserts which are duplicated in delegate method 5213f893 Convert: Remove early return check b61c268b Convert: Extract local variables for readability e278f5a8 Convert: Extract local variables 51bc6bdd cmOutputConverter: remove unused code 8e0c1599 Xcode: Inline ConvertToRelativePath calls
| * cmLocalGenerator: Simplify ConvertToLinkReferenceStephen Kelly2016-10-061-3/+1
| | | | | | | | | | Make conversion to output format the caller responsibility, so that the method only 'converts to a link reference'.
* | cmLocalGenerator: Extract policy handling into a methodStephen Kelly2016-10-061-0/+3
|/
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-7/+13
|
* make sure to include cmConfigure.h before cmStandardIncludes.hDaniel Pfeifer2016-09-031-0/+2
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-4/+4
|
* cmLocalGenerator: Adopt target compile flag generationTobias Hunger2016-06-171-0/+3
| | | | | | Factor the flag generation out of cmCommonTargetGenerator::GetFlags into a new cmLocalGenerator::GetTargetCompileFlags method. This will allow it to be used without a target generator available.
* cmLocalGenerator: Add method to get Fortran-specific compiler flagsBrad King2016-06-171-0/+2
| | | | | | | | | | Add a cmLocalGenerator::GetTargetFortranFlags virtual method to get generator-specific generation of Fortran-specific flags. Implement it in cmLocalCommonGenerator by moving the implementation from cmCommonTargetGenerator::AddFortranFlags. This will allow it to be used without having a target generator available. Inspired-by: Tobias Hunger <tobias.hunger@qt.io>
* Merge topic 'avoid-cmMakefile-IssueMessage-after-configure'Brad King2016-06-131-0/+1
|\ | | | | | | | | | | | | | | ea5324cd cmMakefile: Port messages for compile features to cmake df8c3130 cmGlobalGenerator: Don't use cmMakefile::IssueMessage after configure 946d1e50 cmMakefile: Avoid IssueMessage after configure is finished 096c7754 cmLocalGenerator: Store Backtrace for the directory
| * cmLocalGenerator: Store Backtrace for the directoryStephen Kelly2016-06-121-0/+1
| | | | | | | | Don't rely on cmMakefile to provide that. Use it to issue messages.
* | cmLocalGenerator: Add GetTargetDefines to get all defines for a targetTobias Hunger2016-06-101-0/+3
| |
* | cmLocalGenerator: Constify AppendDefines and AddCompileDefinitionsBrad King2016-06-101-4/+6
|/
* cmLocalGenerator: Adopt GetFrameworkFlags methodTobias Hunger2016-06-091-0/+4
| | | | Move it from cmCommonTargetGenerator.
* cmLocalGenerator: Pass configuration to GetTargetFlagsTobias Hunger2016-06-081-4/+4
| | | | | Move the configuration lookup to call sites. This will allow multi-configuration callers to use the method.
* Use enums defined in cmOutputConverter using their fully qualified name.Daniel Pfeifer2016-05-251-5/+7
| | | | | | | | | Mostly automated: values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT" "OutputFormat" "UNCHANGED" "MAKERULE" "SHELL" "WATCOMQUOTE" "RESPONSE" "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree") for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-61/+49
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* GHS: Shorten long object paths with duplicate source namesGeoff Viola2016-05-061-0/+6
| | | | | Detect when the resulting object path is too long and compute an alternative name using a hash.