summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmSystemTools: copy file member functions accept std::string paramsVitaly Stakhovsky2019-01-291-5/+3
| | | | | Cleaned up `c_str()`s. `cmSystemTools::CopyFileIfDifferent()` removed as redundant.
* Merge topic 'add_consistent_verbose_build_flag'Brad King2019-01-291-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | 66801f4d40 cmake: Add tests for verbose output to --build mode 439fe2e253 cmake: Add options for verbose output to --build mode 638667efa2 cmake: cmcmd.cxx fix "The arguments are" comments 3ca4402966 ctest: Fix --build-and-test without --build-target on Xcode cb6c233ecc cmake: Add -hideShellScriptEnvironment xcodebuild option 1a45266cb5 cmGlobalGenerator: Add a class that represent the build command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2708
| * cmake: cmcmd.cxx fix "The arguments are" commentsFlorian Maushart2019-01-251-6/+6
| | | | | | | | Changed "argv" to "args" in comments to match parameter names
* | cmake: Add --ignore-eol option to `-E compare_files` commandTaylor Braun-Jones2019-01-281-5/+16
| | | | | | | | Fixes: #13007
* | Merge topic 'renamefile-string'Brad King2019-01-251-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 9e5c13738b cmSystemTools::RenameFile: Accepts std::string args Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2842
| * | cmSystemTools::RenameFile: Accepts std::string argsVitaly Stakhovsky2019-01-231-1/+1
| |/
* | Merge topic 'error-overloads'Brad King2019-01-251-5/+5
|\ \ | | | | | | | | | | | | | | | | | | 99337d345b cmSystemTools::Error(): new overload accepting std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2845
| * | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-5/+5
| |/
* | cmLocalUnixMakefileGenerator3: more methods accept std::stringVitaly Stakhovsky2019-01-221-2/+1
|/
* clang-tidy: Use emplaceRegina Pfeifer2019-01-171-8/+8
|
* Properties: Add CMAKE_ROLE global propertyKyle Edwards2019-01-171-2/+4
| | | | | This property allows scripts to determine whether they're in project mode, script mode, find-package mode, CTest, or CPack.
* Fix most clang -Wextra-semi-stmt warnings in C++ filesSean McBride2019-01-151-2/+2
| | | | Suppress one in code generated by flex.
* 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.
* cpplint: only print diagnostics to console if there are errorsjasjuang2019-01-111-3/+6
| | | | Fixes: #18781
* cmake: add error message when '-E touch' failsIsaiah Norton2018-11-271-0/+4
| | | | Issue: #16526
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-12/+12
|
* Merge topic 'msvc-custom-rc-mt'Brad King2018-11-021-2/+10
|\ | | | | | | | | | | | | | | | | | | | | bd9bfc6449 MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe} 0033676796 CUDA: Enable RC language on Windows 02f566a559 MSVC: Factor out enable_language(RC) call into helper macro b601bb6f1c CUDA: Find CMAKE_LINKER on Windows 3eebe28ef4 cmLocalNinjaGenerator: Simplify CreateRulePlaceholderExpander Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2424
| * MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe}Mateusz Zych2018-10-291-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | CMake commands vs_link_dll and vs_link_exe, performing linking on MSVC, are responsible for calling resource compiler and manifest tool. Before this commit, both of these tools were called directly, with the expectation that they are available in the `PATH`. This has been fixed by respecting CMake variables `CMAKE_RC_COMPILER` and `CMAKE_MT` defining paths to these tools. Fixes: #17804
* | Fail the build if cppcheck returns a non-zero exit codeHarald Brinkmann2018-10-111-3/+7
|/ | | | | This allows the build failure to be tuned with cppcheck's options --error-exitcode=<n> and --exitcode-suppressions=<file>.
* cmake: Add '-E create_symlink' support on WindowsJon Chronopoulos2018-09-181-6/+1
| | | | | | | | | | | | The allows `-E create_symlink` to work on Windows. It utilizes `uv_fs_symlink`. I am still unsure exactly which Windows platforms will work without requiring Administrator privileges or needing a user/group with the "Create Symbolic Links" User Rights. It does work with my Windows 10 Pro with Developer Mode turned on. In the test suite check that the symlink either worked or failed with a permissions error. Use recent changes in cmSystemTools::FileExists to check that a symlink is broken.
* Remove unnecessary c_str() callsVitaly Stakhovsky2018-09-051-4/+4
| | | | Use the new IsOn(),IsOff() overloads.
* MSVC: Preserve linker output encodingJustin Goshi2018-08-091-0/+10
| | | | | | | When using the Ninja or Makefile generator with MSVC on Windows we invoke the linker through a `cmake -E vs_link_{exe,dll}` wrapper. Preserve the linker output encoding to match `link.exe` behavior instead of forcing UTF-8.
* MSVC: Fix manifest resource encodingJustin Goshi2018-08-091-0/+2
| | | | | | | When using the Ninja or Makefile generator with MSVC on Windows we invoke the resource compiler (`rc.exe`) to compile a manifest resource. CMake generates the file with UTF-8 encoding so we need to add a pragma to inform the resource compiler.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-7/+8
| | | | | | | | | | | | 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.
* Fix combined use of compiler launcher with lint toolsIlya A. Kriveshko2018-02-271-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using ccache with clang-tidy, ccache needs to wrap compiler invocation, rather than cmake invocation. But it needs to do it without affecting the command line that iwyu-like tools are receiving. With this fix, if __run_co_compile is used, compile launcher is passed using the new --launcher option, but if __run_co_compile is not needed, compiler launcher is prepended to the command line as before. To better illustrate the change: with this fix if running clang-tidy with CXX_COMPILER_LAUNCHER set to "/usr/bin/time;-p;ccache" (time -p added strictly for illustration purposes), the command line changes from: /usr/bin/time -p ccache cmake -E __run_co_compile \ --tidy=clang-tidy ... -- g++ ... to: cmake -E __run_co_compile \ --launcher="/usr/bin/time;-p;ccache" \ --tidy=clang-tidy ... -- g++ ... This allows the compiler to be run via the launcher, but leaves tidy (& friends) invocations unaffected. Fixes: #16493
* Adds file(TOUCH) and file(TOUCH_NOCREATE) sub-commandsShane Parris2018-02-151-2/+0
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-6/+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.
* Make use of std::chrono throughout every componentWouter Klouwen2018-01-231-2/+2
| | | | | | | | This commit continues the changes made in CTest to support std::chrono by applying it throughout every component where a duration was used. No functional change intended.
* Help: Reword misleading docs for cmake -E timeTaylor Braun-Jones2018-01-191-1/+1
|
* cmcmd: Fix cmake_symlink_library for inconsistent slashesBrad King2017-12-201-3/+6
| | | | | | | | With the Ninja generator we may invoke `cmake_symlink_library` with different slash conventions (`/` versus `\`) for different arguments. Fix comparison of the paths/names given to tolerate this. Fixes: #17579
* Update cpplint support to return 0 and mark warnings for CDash.Bill Hoffman2017-12-011-2/+4
| | | | | | | | This commit makes cpplint act like the other compiler mirroring tools. It will always return 0 even if it reports warnings and will only return non zero if there is a problem running the command. In addition, it will now add some extra text to allow CTest to recognize the warnings and report them correctly to CDash.
* Autogen: Rename cmQtAutoGenerators to cmQtAutoGeneratorMocUicSebastian Holtermann2017-11-191-2/+2
|
* Autogen: Introduce standalone RCC generator classSebastian Holtermann2017-11-191-4/+14
| | | | | | | | | Introduces the standalone RCC generator class `cmQtAutoGeneratorRcc`. Every instance of `cmQtAutoGeneratorRcc` class handles the `rcc` invocation for a single `.qrc` file. The class will be used in the future to allow parallel `.qrc` file processing by calling `cmake -E cmake_autorcc <INFO_FILE> <CONFIG>`.
* Merge topic 'windows-mt-update-quiet'Brad King2017-11-101-1/+1
|\ | | | | | | | | | | | | 5c07d390 cmcmd: Fix typo in RunCommand logic Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1473
| * cmcmd: Fix typo in RunCommand logicBrad King2017-11-101-1/+1
| | | | | | | | | | | | | | Fix logic added by commit 18eae3f04d (Windows: Do not report manifest tool update notification as failure, 2017-11-09). Issue: #17444
* | Merge topic 'windows-mt-update-quiet'Brad King2017-11-101-14/+23
|\ \ | |/ | | | | | | | | | | 18eae3f0 Windows: Do not report manifest tool update notification as failure Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1470
| * Windows: Do not report manifest tool update notification as failureBrad King2017-11-091-14/+23
| | | | | | | | | | | | | | | | | | A diagnostic message added in commit v3.10.0-rc1~59^2 (Windows: Improve link-time error messages when rc or mt fail, 2017-09-22) incorrectly reports the `mt /notify_update` special return code as a failure. Fix the logic to consider the special return codes as success. Fixes: #17444
* | Merge branch 'backport-fix-co-compile' into fix-co-compileBrad King2017-10-271-64/+75
|\ \ | |/ | | | | | | Resolve a logical conflict by replacing `cmArray{Begin,End}` from the their side with `cm::{cbegin,cend}` from our side.
| * cmcmd: Restore support for running multiple lint toolsBrad King2017-10-271-56/+66
| | | | | | | | | | | | | | Refactoring in commit v3.10.0-rc1~115^2 (Clean up iwyu code to not be one big if statement, 2017-08-28) incorrectly changed the logic to run only one lint tool at a time. Restore support for running all tools specified on the command-line.
| * cmcmd: Convert lint handlers to file-static functionsBrad King2017-10-271-11/+12
| | | | | | | | These do not need to be declared in the header.
| * cmcmd: Rename loop iteration variable for clarityBrad King2017-10-271-2/+2
| |
* | Replace cmArray{Begin,End,Size} by their standard counterpartsMatthias Maennich2017-10-231-2/+3
|/ | | | | | | | | | | std::{begin,end} are part of C++11, std::{cbegin,cend} are part of C++14 and an standard compliant implementation has been introduced within the 'cm' namespace: cm::{cbegin,cend}. std::size is only part of C++17, hence exposing a compliant implementation within namespace cm (cm::size). where possible, the standard implementations are reused.
* cmcmd: let operator<< for NumberFormatter reset the stream's format flagsMatthias Maennich2017-10-051-1/+3
|
* Improve several occurrences of vector::push_back in loopsMatthias Maennich2017-09-281-0/+1
| | | | | | | Fix issues diagnosed by clang-tidy by pre-allocating the vector capacity before the loop [performance-inefficient-vector-operation]. Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-3/+3
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Windows: Improve link-time error messages when rc or mt failJonathan Marler2017-09-221-32/+62
| | | | | | We run extra tools during linking on Windows to deal with manifests. Report more information when these tools fail. For example, if the Windows SDK is not installed with VS then `rc.exe` will be missing.
* Enable clang-tidy modernize-loop-convert lintBrad King2017-09-191-5/+2
| | | | | Fix remaining diagnostics by this lint and remove it from our list of disabled lints.
* Merge topic 'refactor-iwyu-code'Brad King2017-09-151-228/+279
|\ | | | | | | | | | | | | 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-228/+279
| | | | | | | | | | | | | | | | | | | | 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-6/+5
|/ | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.