summaryrefslogtreecommitdiffstats
path: root/Source/cmCPluginAPI.cxx
Commit message (Collapse)AuthorAgeFilesLines
* GENERATED prop: Add implementation for policy CMP0118 being set to NEWDeniz Bahadir2020-11-241-0/+5
| | | | | | | | | | | | | | | | | | * Adding implementation for policy CMP0118 being set to `NEW`. * Adding new tests for policy CMP0118 being set to `NEW`. * Checking the `GENERATED` property with `get_source_file_property` or `get_property` now always returns exactly `1` or `0`. No other values will be returned. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * Additionally, as `get_source_file_property` and `get_property` now always check if a source-file was marked globally visible, even when CMP0118 is unset or set to `OLD`, they possibly return `1` where they might have returned `0` before the changes introduced by this commit. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * As a consequence, the tests for policy CMP0118 being unset or set to `OLD` got slightly adjusted, too, to reflect these changes in behavior.
* Reduce the scope of temporary cmProp variables and other improvementsVitaly Stakhovsky2020-11-051-4/+2
|
* cmListFileCache: Make cmListFileFunction a shared pointerOleksandr Koval2020-10-011-3/+6
| | | | | Passing cmListFileFunction everywhere by-value involves big overhead. Now cmListFileFunction stores std::shared_ptr to the underlying data.
* Refactor: Use cmToCStr()Vitaly Stakhovsky2020-09-031-2/+2
|
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-1/+1
|
* cmSourceFile::GetProperty: return cmPropVitaly Stakhovsky2020-04-141-1/+2
|
* Merge topic 'prop_t'Brad King2020-03-171-1/+2
|\ | | | | | | | | | | | | 60f57d0dcc cmPropertyMap: Introduce cmProp as return type for GetProperty() functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4471
| * cmPropertyMap: Introduce cmProp as return type for GetProperty() functionsVitaly Stakhovsky2020-03-131-1/+2
| | | | | | | | | | | | | | Currently properties are usually stored internally as `std::string`. However, family of GetProperty() functions return them as `const char *` using `c_str()`. The proposed `cmProp`, typedef'ed as `const std::string *` will expose properties more naturally.
* | cmPropertyDefinition: Construct directly in defined stateVitaly Stakhovsky2020-03-131-2/+3
|/ | | | | Move `cmPropertyDefinitionMap::DefineProperty` functionality directly into the constructor to avoid an intermediate state.
* Modernize memory managementMarc Chevrier2020-02-271-25/+9
| | | | Update internals of various classes
* cmMakefile: Delay custom command creationDaniel Eiband2019-11-241-3/+3
| | | | | | | | Move custom command creation to cmLocalGenerator and dispatch custom commands in cmMakefile to generate time. Generators add custom commands using the new methods provided by cmLocalGenerator. Issue: #12877
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-2/+2
| | | | | 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.
* cmMakefile: Remove AddUtilityCommand overload without byproductsDaniel Eiband2019-09-261-1/+3
|
* cmMakefile: Move enumerations into new headerDaniel Eiband2019-09-261-5/+5
| | | | The enumerations will also be used in cmLocalGenerator.
* cmSourceFile: Remove non-const GetProperties accessorDaniel Eiband2019-09-211-1/+1
| | | | | | Manipulating the property map of cmSourceFile directly may invalidate the class invariant of the cached value IsGenerated. Provide the setter SetProperties which also updates IsGenerated.
* 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.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-3/+3
|
* cmSourceFile: Rename mutating GetFullPath() overloadDaniel Eiband2019-08-291-1/+1
| | | | Rename mutating GetFullPath() overload to ResolveFullPath().
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-1/+1
| | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-2/+4
| | | | | | | | | | | | | | | | This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value argument instead of a `const char *`. Benefits are: - `std::string` can be passed to `cmMakefile::AddDefinition` directly without the `c_str()` plus string length recomputation fallback. - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at compile time. In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid `std::string::c_str` calls and the `std::string` is passed directly. Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
* cmCommand: deprecate functions GetMakefile and SetErrorDaniel Pfeifer2019-07-211-1/+1
| | | | | | | | | Replace the members for the Makefile and the Error with a cmExecutionStatus. Re-implement GetMakefile and SetError based on that. Both functions should be called directly on the cmExecutionStatus that is passed to InitialPass. This will help us make all Commands immutable and remove the need for cloning.
* cmSystemTools::Error(): remove const char* overloadVitaly Stakhovsky2019-05-221-2/+2
|
* Delete some default constructors and assignment operatorsAlbert Astals Cid2019-02-151-0/+4
| | | | | | They are unused, but if someone used them they would lead to problems since they would copy the internal raw pointers and the destructor would cause double delete
* Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-14/+10
| | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* Merge topic 'tidy-use-equals-default'Brad King2019-01-291-1/+0
|\ | | | | | | | | | | | | | | | | 094f01d0f0 cleanup: Prefer compiler provided special member functions 55671b41d2 clang-tidy: Use `= default` Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Brad King <brad.king@kitware.com> Merge-request: !2841
| * cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-1/+0
| |
| * clang-tidy: Use `= default`Regina Pfeifer2019-01-251-1/+1
| | | | | | | | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-1/+1
|/
* clang-tidy: Use emplaceRegina Pfeifer2019-01-171-8/+7
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-2/+2
| | | | Reduce the number of files relying on `cmake.h`.
* Source: Fix various compiler warnings in Visual Studio 2017Bruno Manganelli2019-01-091-1/+1
|
* clang-tidy: Use default member initializationRegina Pfeifer2018-12-151-5/+2
|
* LINK_DIRECTORIES: Add new properties and commandsMarc Chevrier2018-09-251-1/+1
| | | | | | | | | | | | 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: return directories as const std::string&Vitaly Stakhovsky2018-08-271-4/+4
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-4/+5
| | | | | | | | | | | | 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.
* cmMakefile: Improve ExpandVariablesInString return typeVitaly Stakhovsky2018-05-011-1/+2
| | | | | Return `std::string const&` instead of a `const char*` that points into a string anyway. Update call sites accordingly.
* cmCPluginAPI: Remove a few unnecessary c_str() callsVitaly Stakhovsky2018-05-011-3/+3
|
* 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.
* server: return whether or not a target is generator providedJustin Goshi2017-11-201-2/+2
| | | | | | Some generators auto-generate targets. For example VS generators create the ALL_BUILD target. Add the ability to mark targets as generator provided and return that info through cmake-server codemodel.
* cmCPluginAPI: remove explicit casts to void*Rolf Eike Beer2017-09-231-5/+4
|
* cmCPluginAPI: do not check pointer before calling free()Rolf Eike Beer2017-09-231-3/+1
|
* cmCPluginAPI: use strdup() instead of open coding itRolf Eike Beer2017-09-231-17/+5
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-5/+4
| | | | | | 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-11/+11
|
* clang-tidy: apply readability-redundant-control-flow fixesDaniel Pfeifer2016-12-121-1/+0
|
* cmCPluginAPI: Fix clang-tidy findingsDaniel Pfeifer2016-11-051-4/+4
|
* Separate compilation for commands included in cmCommandsDaniel Pfeifer2016-10-211-2/+4
|
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-6/+6
| | | | Port dependent code to the change.