summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Drop Visual Studio 8 2005 generatorBrad King2018-04-021-1/+1
| | | | This generator has been deprecated since CMake 3.9. Remove it.
* cmSystemTools: Fix ParseArguments out-of-bounds readBrad King2018-03-271-6/+7
| | | | | | | When checking for a Windows-style leading path, do not read past the null terminator. Issue: #17854
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-12/+13
| | | | | | | | | | * 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.
* Merge topic 'reduce-temporaries'Brad King2018-01-291-1/+1
|\ | | | | | | | | | | | | c85bb007 Reduce allocation of temporary values on heap. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1698
| * Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-1/+1
| | | | | | | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* | Merge topic 'ctest-chrono'Brad King2018-01-261-5/+8
|\ \ | |/ |/| | | | | | | | | | | | | e6a80ccf Make use of std::chrono throughout every component ff62b005 CTest: add safe conversion from cmDuration to integer types 695951bc CTest: introduce cmDuration Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1592
| * Make use of std::chrono throughout every componentWouter Klouwen2018-01-231-5/+8
| | | | | | | | | | | | | | | | 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.
* | Windows: Add support for running CMake tools through a symlinkPavel P2018-01-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | When `cmake.exe` is executed through a symlink, `GetModuleFileNameW` will return location of the link instead of the real path of `cmake.exe`. This results in the following error output: CMake Error: Could not find CMAKE_ROOT !!! CMake has most likely not been installed correctly. Use `cmSystemTools::GetRealPath` in `FindCMakeResources` on Windows to resolve any symlink returned by `GetModuleFileNameW`.
* | Extend libuv file translate mode workaround to all executablesBrad King2018-01-231-0/+17
|/ | | | | | | | | | | | | | | Since libuv commit v1.14.1~7 (win: add uv__once_init() calls, 2017-08-30) the libuv initialization of the file translate mode may take place even if we do not use a uv loop. This change was included in our libuv update commit f4a26c748b (libuv 2018-01-19). Therefore use of libuv even through `cmSystemTools::GetRealPath` in any executable may trigger its file translate mode setting. Factor out the logic added to `cmake.exe` by commit v3.9.0-rc4~10^2 (cmake: Fix default file translate mode when using libuv, 2017-06-13) and re-use to initialize all executables. Issue: #16962
* CUDA: Add cu as default source file extensionRobert Maynard2018-01-081-0/+3
|
* cmSystemTools: Implement GetRealPath on WindowsManuel Núñez2017-10-241-0/+35
| | | | | | | Override the KWSys GetRealPath on Windows and use uv_fs_realpath first to resolve symbolic links. Fixes: #17206
* Fix occurrences of readability-non-const-parameterMatthias Maennich2017-09-281-12/+14
| | | | | | | | | | | Fix issues diagnosed by clang-tidy [readability-non-const-parameter] The patch separates the definitions of the function headers for the two variants (CMAKE_USE_ELF_PARSER or not) and comments out the parameter names to not consider them for any const-ness in the case they are actually not even looked at. Signed-off-by: Matthias Maennich <matthias@maennich.net>
* 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>
* Clean up some C-Style castsMatthias Maennich2017-09-281-1/+1
| | | | | | Fix issues diagnosed by clang-tidy [google-readability-casting] Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Merge topic 'rc-missing-better-error'Brad King2017-09-251-0/+4
|\ | | | | | | | | | | | | | | 0a8e23ad Windows: Improve link-time error messages when rc or mt fail c2d6835c cmSystemTools: Teach RunSingleCommand another way to report exceptions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1260
| * cmSystemTools: Teach RunSingleCommand another way to report exceptionsJonathan Marler2017-09-201-0/+4
| | | | | | | | | | If the caller captures stdout but not stderr then report exceptions through stdout instead of dropping them.
* | Replace empty-string comparisons with checking against `empty()`.Pavel Solodovnikov2017-09-211-1/+1
|/
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-7/+7
|
* Merge topic 'get_filename_component-fix-program-split'Brad King2017-09-141-0/+50
|\ | | | | | | | | | | | | 31f73eb1 get_filename_component: Revise PROGRAM/PROGRAM_ARGS split semantics Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1251
| * get_filename_component: Revise PROGRAM/PROGRAM_ARGS split semanticsBrad King2017-09-131-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The KWSys `SystemTools::SplitProgramFromArgs` implementation goes into an infinite loop when the value is just " " (a space). Since the "program path with unquoted spaces plus command-line arguments" operation it is trying to provide is poorly defined (string parsing should not depend on filesystem content), just stop using it. Instead consider the main two use cases the old approach tried to handle: * The value is the name or absolute path of a program with no quoting or escaping, but also no command-line arguments. In this case we can use the value as given with no parsing, and assume no arguments. * The value is a command-line string containing the program name/path plus arguments. In this case we now assume that the command line is properly quoted or escaped. Fixes: #17262
* | Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-22/+14
|/ | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Replace C-style castsDaniel Pfeifer2017-08-271-7/+8
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-13/+13
|
* Change ComputeFileMD5 to ComputeFileHashAndré Klitzing2017-07-141-8/+6
| | | | | | | * Use a parameter to select hash algorithm * Return a std::string as result or an empty string if it fails * Avoids unnecessary copy of hash value
* Remove second arg: npos in substr usagesPavel Solodovnikov2017-06-011-2/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-1/+2
|
* Remove unused variablesPavel Solodovnikov2017-05-261-1/+0
|
* Change std::basic_string<char> to std::stringPavel Solodovnikov2017-05-241-6/+6
|
* Merge topic 'ninja-dyndep-response-file'Brad King2017-04-251-0/+33
|\ | | | | | | | | | | | | 594d3d6f Ninja: support response file for cmake_ninja_depends on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !722
| * Ninja: support response file for cmake_ninja_depends on WindowsBernhard Burgermeister2017-04-251-0/+33
| | | | | | | | | | | | | | The internal tool "cmake_ninja_depends" now supports reading the list of ddi files from a reponse file to circumvent Windows command line length limits. Use this response file for dyndep rule on Windows.
* | Merge topic 'clang-tidy'Brad King2017-04-241-24/+25
|\ \ | |/ |/| | | | | | | | | | | | | | | 73020305 clang-tidy: avoid copy b432e933 clang-tidy: use .empty() to check emptyness 012972a9 clang-tidy: remove reduntant .data() calls b26577c9 clang-tidy: remove else after break and continue Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !734
| * clang-tidy: remove else after break and continueDaniel Pfeifer2017-04-211-24/+25
| |
* | Merge topic 'unified-commandline-length'Brad King2017-04-211-0/+40
|\ \ | |/ |/| | | | | | | | | bbb5c3ef Ninja,Makefile: Unify command line limit logic Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !705
| * Ninja,Makefile: Unify command line limit logicChristian Pfeiffer2017-04-191-0/+40
| | | | | | | | | | | | Move the logic to cmSystemTools to be shared among the generators. Revise the implementation and add comments justifying each possible source for a limit.
* | Drop Visual Studio 7 .NET 2003 generatorBrad King2017-04-191-2/+0
|/ | | | This generator has been deprecated since CMake 3.6. Remove it.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-7/+7
| | | | | | | | | | | | | 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'
* Add self-sufficient wrapper for <sys/stat.h>Daniel Pfeifer2017-03-241-1/+1
|
* IWYU: use pragma exportDaniel Pfeifer2017-03-231-1/+0
|
* Merge topic 'iwyu'Brad King2017-02-201-0/+1
|\ | | | | | | | | | | | | | | | | | | | | d58d28a9 ParserHelper: Move macros to bottom of files 07953c18 remove file cmStandardIncludes.h f918b053 cmFortranParser: include what you use b74314c6 cmDependsJavaParser: include what you use 74404df4 cmCommandArgumentParser: include what you use e7168c08 cmExprParser: include what you use ee72803e fix some include-what-you-use diagnostics
| * fix some include-what-you-use diagnosticsDaniel Pfeifer2017-02-171-0/+1
| |
* | Make CMAKE_ROOT independent of case of path used to invoke cmakeBrad King2017-02-171-2/+2
|/ | | | | | | | | | | | | | We compute the location of `CMAKE_ROOT` and other resources relative to the location of our own executable. On some platforms this path is computed in a way that depends on the case of the path used to invoke the executable. Convert the result to the actual case preserved by the filesystem on disk in order to make it consistent regardless of how the executable is launched. This approach generalizes the fix made by commit v3.8.0-rc1~71^2 (cmSystemTools: use the actual case for root detection, 2017-01-18). Issue: #16648
* Merge topic 'case-insensitive-bindir-detection'Brad King2017-01-201-1/+2
|\ | | | | | | | | 7f0a21a5 cmSystemTools: use the actual case for root detection
| * cmSystemTools: use the actual case for root detectionBen Boeckel2017-01-181-1/+2
| | | | | | | | | | | | | | | | | | On Windows, calling a binary installed with the default `bin` binary directory will fail to be detected when called as `BIN\cmake.exe` due to the string compare. Get the actual case of the path before checking that the path ends with `CMAKE_BIN_DIR`. Fixes #16574.
* | clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-1/+1
| |
* | Add Encoding option for RunChild, RunMakeCommand and RunProcessDāvis Mosāns2016-11-141-2/+2
| |
* | Windows: Encode child process output to internally-used encodingDāvis Mosāns2016-11-141-4/+39
| | | | | | | | | | | | Typically Windows applications (eg. MSVC compiler) use current console's codepage for output to pipes so we need to encode that to our internally-used encoding (`KWSYS_ENCODING_DEFAULT_CODEPAGE`).
* | Port hash computation to cmCryptoHashBrad King2016-11-101-4/+4
| | | | | | | | | | Avoid using KWSys MD5 or `cm_sha2` and use the `cmCryptoHash` abstraction instead.
* | cmCryptoHash: Avoid using subclasses at client sitesBrad King2016-11-101-4/+4
| | | | | | | | Use only the main `cmCryptoHash` interface.
* | cmSystemTools: Flush output buffer for list_item_verboseDāvis Mosāns2016-10-131-0/+1
| | | | | | | | | | When `std::cout` and `FILE *stdout` are used at same time need to explicitly flush otherwise they can be out of sync.
* | cmSystemTools, elf: handle DT_MIPS_RLD_REL_MAP in RemoveRPathJames Cowgill2016-10-071-0/+24
| |