summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'restore-cwd-translation-map' into release-3.18Brad King2020-07-031-0/+6
|\ | | | | | | | | | | | | 85a945a607 Restore handling of build directory inside a symlinked path Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4963
| * Restore handling of build directory inside a symlinked pathBrad King2020-07-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit dd8365b3f1 (Merge branch 'upstream-KWSys' into update-kwsys, 2020-04-06, v3.18.0-rc1~397^2) we imported KWSys commit `019afb6ea` (SystemTools: Drop GetCurrentWorkingDirectory 'collapse' argument, 2020-04-03). That caused `GetCurrentWorkingDirectory` to no longer send paths through the KWSys translation map and broke CMake's detection of the absolute path to a build directory containing a symbolic link. Add our own `cmSystemTools::GetCurrentWorkingDirectory` wrapper around the KWSys method in order to restore that mapping. Test-case-by: Ben Boeckel <ben.boeckel@kitware.com> Issue: #16228 Fixes: #20900
* | cmake: Tolerate nullptr from uv_default_loopBrad King2020-07-011-1/+3
|/ | | | | | | `uv_default_loop()` can return `nullptr` when running on a Linux kernel configured without `CONFIG_EVENTFD`. Fixes: #20899
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-2/+3
| | | | Fixes: #20666
* Merge topic 'parallel-lzma-compression'Brad King2020-04-061-0/+1
|\ | | | | | | | | | | | | | | | | | | | | b3bacf0152 cmCPackArchiveGenerator: support multithreaded compression b71d385ed4 cmCPackArchiveGenerator: support setting archive options 948aa8bd1c cmArchiveWrite: support setting archive filter options b9c17de023 cmArchiveWrite: split out opening the file Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Cristian Adam <cristian.adam@gmail.com> Merge-request: !3195
| * cmArchiveWrite: split out opening the fileBen Boeckel2020-03-311-0/+1
| | | | | | | | | | This allows options to be set before the "header" phase of libarchive's API.
* | Merge topic 'string-prefix'Brad King2020-03-261-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ec7928ef26 use _s to construct static string_views at several places 94de927cab VS10Generator: avoid many string allocations 8ca2504a4d use string_views to avoid memory allocations 761f1adcae check for a valid URL scheme before starting to do any splitting ef778d77e0 replace std::string::substr() with operations that do not allocate memory 77616f4681 pass cm::string_view to cmVisualStudioSlnParser::ParseTag() ada6a3226f use cm::string_view for language extension lookups 48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix() ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4501
| * | replace "substr(0, xx) ==" with cmHasPrefix()Rolf Eike Beer2020-03-231-2/+1
| |/
* | CMake compilation: do not use compiler extensionsMarc Chevrier2020-03-231-0/+10
|/ | | | | | | For now, compiler extensions are no longer activated on CMake sources. However these extensions are still used for various third parties. This MR is a partial answer to the issue #20454.
* Modernize memory managementMarc Chevrier2020-02-271-5/+6
| | | | Update internals of various classes
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-8/+9
|
* Windows: Restore suppression of error report popups in CI buildsBrad King2019-11-151-0/+2
| | | | | | | | | | | | | On Windows, libuv uses `_CrtSetReportHook` to install a handler it uses to suppress assertions on invalid file descriptors in `_get_osfhandle`. This removes the handler we install in CI environments to suppress interactive popups. Move installation of our handler to after libuv is initialized so that our handler is actually used. Unfortunately this also removes libuv's handler and so may cause Debug builds under CI to abort on invalid file descriptors instead of simply converting them to `INVALID_HANDLE_VALUE`. If this becomes a problem we may need to modify libuv to make its hook more configurable.
* ForceToRelativePath: Fix spurious assertion when local path is root dirCraig Scott2019-11-021-2/+7
| | | Fixes: #19909
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-10/+15
| | | | | 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.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-7/+7
|
* Merge topic 'modernize-use-auto'Brad King2019-09-121-4/+3
|\ | | | | | | | | | | | | d25a5a7ec9 clang-tidy: modernize-use-auto Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3783
| * clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-4/+3
| | | | | | | | | | | | 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.
* | cmSystemTools: introduce MoveFileIfDifferent()Rolf Eike Beer2019-09-091-0/+12
|/
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-54/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* clang-tidy: isolate declarations for readabilityRegina Pfeifer2019-08-201-1/+2
|
* cmSystemTools: Remove IsInternallyOn, IsNOTFOUND, IsOn, IsOffSebastian Holtermann2019-08-171-79/+0
| | | | | | | | | The removes the following methods from cmSystemTools: - `IsInternallyOn` - `IsNOTFOUND` - `IsOn` - `IsOff`
* Merge topic 'cmExpandList'Kyle Edwards2019-08-161-73/+0
|\ | | | | | | | | | | | | | | | | 2f6495e24e cmSystemTools: Remove ExpandListArgument methods f4f3c68926 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument ff42dec891 cmStringAlgorithms: Add cmExpandList functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3682
| * cmSystemTools: Remove ExpandListArgument methodsSebastian Holtermann2019-08-141-73/+0
| |
* | Merge topic 'cmStringAlgorithms_ulong'Kyle Edwards2019-08-161-22/+0
|\ \ | |/ |/| | | | | | | | | 935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3681
| * cmStringAlgorithms: Add cmStrToLong and cmStrToULongSebastian Holtermann2019-08-101-22/+0
| | | | | | | | | | | | | | | | This adds the following functions to cmStringAlgorithms: - `cmStrToLong`: moved from `cmSystemTools::StringToLong` - `cmStrToULong`: moved from `cmSystemTools::StringToULong` Overloads of the given functions for `std::string` are added as well.
* | Merge topic 'retry-directory-delete'Kyle Edwards2019-08-131-2/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | 6bc77966ad Retry removing directories on Windows 5729580376 Use registry setting for removal retry count and delay Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3667
| * | Use registry setting for removal retry count and delayKasper Laudrup2019-08-081-2/+8
| |/ | | | | | | | | | | | | Instead of hardcoding the amount of retries and the time to sleep between them when removing directories on Windows, use the setting potentially present in the registry instead. This setting is already used when retrying moving directories.
* | Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-14/+14
|/
* Merge topic 'tidy_inefficient_string'Brad King2019-08-071-1/+1
|\ | | | | | | | | | | | | 18b0330b86 clang-tidy: Enable performance-inefficient-string-concatenation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3648
| * clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-1/+1
| | | | | | | | | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* | cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenizeSebastian Holtermann2019-08-051-60/+1
|/ | | | | | | | | | This adds the following functions to `cmStringAlgorithms`: - `cmIsSpace` - `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`) - `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`) - `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to accept `cm::string_view`)
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* cmSystemTool: Let TrimWhitespace accept a cm::string_viewSebastian Holtermann2019-07-281-6/+6
|
* cmSystemTool: Let HelpFileName accept a cm::string_viewSebastian Holtermann2019-07-281-1/+2
|
* cmSystemTool: Let EscapeQuotes accept a cm::string_viewSebastian Holtermann2019-07-281-4/+4
|
* cmSystemTool: Let Expand(ed)ListArgument accept a cm::string_viewSebastian Holtermann2019-07-281-13/+17
|
* Merge topic 'remove_compiler_rpath'Kyle Edwards2019-07-261-2/+6
|\ | | | | | | | | | | | | | | bd2793b6e9 Help: Add documentation for INSTALL_REMOVE_ENVIROMENT_RPATH f08dcbffec Property: Add INSTALL_REMOVE_ENVIROMENT_RPATH property Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3544
| * Property: Add INSTALL_REMOVE_ENVIROMENT_RPATH propertyJiang Yue2019-07-251-2/+6
| |
* | cmSystemTools: Make IsInternallyOn, IsON and IsOff cm::string_view basedSebastian Holtermann2019-07-241-95/+65
|/
* cmSystemTools: Remove cmSystemTools::FileFormat methodSebastian Holtermann2019-07-041-59/+0
|
* Merge topic 'string-tar'Brad King2019-05-301-6/+6
|\ | | | | | | | | | | | | 57cedb18c0 cmSystemTools: std::string parameters for tar functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3392
| * cmSystemTools: std::string parameters for tar functionsVitaly Stakhovsky2019-05-291-6/+6
| |
* | Merge topic 'tar-zstd-compression'Brad King2019-05-301-0/+3
|\ \ | |/ |/| | | | | | | | | 53cb1f2d04 cmake: Teach cmake -E tar command, Zstandard compression Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3357
| * cmake: Teach cmake -E tar command, Zstandard compressionBartosz Kosiorek2019-05-221-0/+3
| | | | | | | | Fixes #18657
* | Merge topic 'selective-tar-extracting-and-listing'Brad King2019-05-241-5/+54
|\ \ | | | | | | | | | | | | | | | | | | c8e217e0a7 cmake: tar: Allow selective extracting and listing of archives Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3342
| * | cmake: tar: Allow selective extracting and listing of archivesBartosz Kosiorek2019-05-231-5/+54
| | |
* | | Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-7/+7
|/ /
* | Merge topic 'string-error'Brad King2019-05-231-30/+15
|\ \ | | | | | | | | | | | | | | | | | | e884b1b693 cmSystemTools::Error(): remove const char* overload Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3360
| * | cmSystemTools::Error(): remove const char* overloadVitaly Stakhovsky2019-05-221-30/+15
| |/
* | cmSystemTools: Remove cmSystemToolsFileTime interfaceSebastian Holtermann2019-05-221-122/+0
|/ | | | | This removes the C style cmSystemToolsFileTime interface in cmSystemTools. It was replaced by the RAII based cmFileTimes class.