summaryrefslogtreecommitdiff
path: root/Source/cmVariableWatchCommand.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).
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* cmListFileCache: Make cmListFileFunction a shared pointerOleksandr Koval2020-10-011-4/+5
| | | | | Passing cmListFileFunction everywhere by-value involves big overhead. Now cmListFileFunction stores std::shared_ptr to the underlying data.
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+3
|
* cmMakefile::GetProperty: return cmPropVitaly Stakhovsky2020-04-011-1/+1
|
* cmMakefile: Delay CheckTargetProperties and FinalPass to generate timeDaniel Eiband2019-11-241-2/+4
|
* Refactor: Modernize `cmVariableWatchCommand` a littleAlex Turbov2019-10-171-34/+31
|
* Refactor: Use cmStrCat to construct error stringsAsit Dhal2019-09-181-14/+10
| | | | | Replace string construction using std::stringstream with cmStrCat and cmWrap.
* clang-tidy: Resolve performance-unnecessary-value-param diagnosticsBrad King2019-09-091-0/+1
| | | | | | Fix diagnostics that appear on macOS with clang-tidy-8. Suppress cases where we intentionally take an argument by value to let the caller choose whether to copy or move.
* cmCommand refactor: cmVariableWatchCommandGabor Bencze2019-08-201-6/+8
|
* 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.
* cmVariableWatchCommand: Port away from FinalPassDaniel Pfeifer2019-07-181-8/+33
|
* Merge topic 'tidy-use-equals-default'Brad King2019-01-291-3/+1
|\ | | | | | | | | | | | | | | | | 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
| * clang-tidy: Use `= default`Regina Pfeifer2019-01-251-3/+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
|/
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-1/+2
| | | | Reduce the number of files relying on `cmake.h`.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-10/+8
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-4/+2
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Add const-reference qualificationsPavel Solodovnikov2017-05-261-1/+1
|
* Separate compilation for commands included in cmCommandsDaniel Pfeifer2016-10-211-0/+7
|
* 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.
* use empty method to check for emptynessDaniel Pfeifer2016-09-151-1/+1
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-54/+42
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* cmListFile: Remove FilePath member from cmListFileContext.Stephen Kelly2015-07-061-1/+0
| | | | | There is no need to store the FilePath for every function, as it is known by other means.
* cmListFileArgument: Remove FilePath member.Stephen Kelly2015-06-211-6/+6
| | | | It is now unused.
* cmVariableWatchCommand: Simplify error reporting.Stephen Kelly2015-06-031-4/+1
|
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-3/+3
| | | | All compilers hosting CMake support the std class.
* Remove c_str calls when using stream APIs.Stephen Kelly2014-03-111-2/+2
| | | | | Use an ad-hoc clang tool for matching the calls which should be ported.
* Remove some c_str() calls.Stephen Kelly2014-03-111-1/+1
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* Merge branch 'dev/fix-variable-watch-crash' into cmake-syntaxBrad King2013-08-081-56/+85
|\ | | | | | | | | Resolve conflict in Source/cmVariableWatchCommand.cxx by integrating the changes from both sides.
| * variable_watch: Check newValue for NULLBen Boeckel2013-08-081-1/+1
| | | | | | | | | | On read access, newValue can be NULL since there is no new value, so use the empty string instead.
| * variable_watch: Don't share memory for callbacksBen Boeckel2013-08-081-54/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command itself is owned by the cmMakefile class, but the cmVariableWatch which holds a pointer to the cmVariableWatchCommand via the client_data for the callback outlives the cmMakefile class in the Qt GUI. This means that when the cmMakefile is destroyed, the variable watch is still in effect, but with a stale pointer. To fix this, each callback is now a separate entity completely and doesn't rely on the command which spawned it at all. An example CMakeLists.txt which demonstrates the issue (only displayed in cmake-gui, so no tests can be written for it): set(var 0) variable_watch(var)
| * variable_watch: Fix a typo in the error messageBen Boeckel2013-08-081-1/+1
| | | | | | | | There was no space between "callback" and the quoted command name.
* | cmListFileArgument: Generalize 'Quoted' bool to 'Delimeter' enumBrad King2013-08-081-5/+10
|/ | | | | | Replace the boolean value that indicates whether an argument is unquoted or quoted with a generalized enumeration of possible argument types. For now "Quoted" and "Unquoted" remain the only types.
* variable_watch: Print accesses as "CMake Debug Log" messagesBrad King2013-06-031-5/+3
| | | | | | Use makefile->IssueMessage() to print the unprocessed watch message in a format consistent with other CMake messages and with a more complete call stack for the access.
* variable_watch: Remove leftover debugging code (#14187)Brad King2013-06-031-13/+0
| | | | | | | | | | When a watch does not specify a command to call then variable_watch prints out a message to stderr. Remove code after that which collects all variable values to construct a message that is never printed. Otherwise such code causes a READ_ACCESS watch to trigger on all variables in the currents scope. Reported-by: Yichao Yu <yyc1992@gmail.com>
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-1/+1
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* ENH: add return and break support to cmake, also change basic command ↵Ken Martin2008-01-231-2/+4
| | | | invocation signature to be able to return extra informaiton via the cmExecutionStatus class
* STYLE: Fix line lengthsAndy Cedilnik2007-04-121-7/+14
|
* ENH: Add variable watch commandAndy Cedilnik2007-04-111-0/+136