summaryrefslogtreecommitdiffstats
path: root/Source/cmCPluginAPI.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Trace: include `line_end` field in json-v1 formatBraulio Valdivielso Martinez2022-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | After !6954 got merged, it has become easier for tools to get full stack-traces for runtime traces of a CMake program. The trace information already included in the JSON objects (line number, source file path) allows tools that display these stack traces to print the CMake source code associated to them. However, CMake commands may spawn multiple lines, and the JSON information associated to a trace only contains the line in which the command started, but not the one in which it ended. If tools want to print stack traces along the relevant source code, and they want to print the whole command associated to the stack frame, they will have to implement their own CMake language parser to know where the command ends. In order to simplify the life of those who want to write tooling for CMake, this commit adds a `line_end` field to the json-v1 trace format. If a given command spans multiple lines, the `line_end` field will contain the line of the last line spanned by the command (that of the closing parenthesis associated to the command).
* cmCustomCommand: Track main dependency explicitlyNAKAMURA Takumi2021-12-141-1/+2
| | | | | | | Store the main dependency as the first entry in the dependency list plus a boolean member indicating its existence. Note that this slightly changes existing behavior: the main dependency was previously the last entry of the dependency list.
* cmMakefile: Simplify Add*Command and adopt to cmAddCustom*CommandNAKAMURA Takumi2021-11-181-13/+12
|
* cmMakefile: Move CMP0116 lookup into Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-8/+4
| | | | Avoid repeating it at every call site.
* Source: fix clang-tidy modernize-redundant-void-arg warningSean McBride2021-10-251-1/+1
|
* Source: fix many -Wmissing-prototypes warnings by marking functions staticSean McBride2021-10-251-87/+93
|
* remove cmToCStr functionMarc Chevrier2021-09-191-3/+3
|
* Refactor: Convert parallel string/backtrace vectors to BT vectorsKyle Edwards2021-09-031-1/+1
|
* Source: Minor code improvementsVitaly Stakhovsky2021-05-111-1/+1
|
* cmCustomCommand: Record value of CMP0116 at time of creationKyle Edwards2021-02-231-4/+8
|
* clang-tidy: fix `readability-simplify-boolean-expr` warningsBen Boeckel2021-01-271-2/+2
|
* clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-1/+1
|
* 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.