summaryrefslogtreecommitdiffstats
path: root/Source/Checks/cm_cxx_filesystem.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Source: Enhance check for C++17 filesystem supportMichael Hirsch2023-12-051-2/+9
| | | | | | | | | | | | * Add `lexically_normal` test for all platforms. * On Windows, MinGW does not currently handle `lexically_normal()` correctly on UNC path, but MSVC and IntelLLVM do--add a comment on this to avoid future confusion. * Add test with `\\?\` notation and `weakly_canonical` that also triggers the MinGW bug, but is fine with MSVC and oneAPI, for a more robust and comprehensive test.
* cmCMakePath: do not use std::filesystem::path with RH gcc-toolset-10Marc Chevrier2023-12-041-0/+28
| | | | Fixes: #25458, #25453
* cm/filesystem: Fix crash with pre-C++11 std::string GNU ABI in C++17Brad King2022-10-201-0/+11
| | | | | | | | | | | | | | | | | | | The `remove_filename` and `replace_extension` methods compute an offset between the whole path in a `std::string` and a part of a path in a `std::string_view`. This is done by subtracting their `.data()` pointers. However, C++17 adds a non-const `.data()` through which modification of the string is allowed. This means the copy-on-write implementation used by the pre-C++11 std::string GNU ABI must reallocate if the string has been copied. Our subtraction then computes an offset between two different allocations, which is undefined behavior. The workaround in commit b3ca4f9ad1 (cm/filesystem: Work around crash when compiled for CYGWIN/MSYS runtime, 2021-04-22, v3.21.0-rc1~271^2~2) avoided the problem by calling the non-const `.data()` to reallocate before constructing the `string_view`. Instead, explicitly call the const `.data()` method on the string, which does not reallocate. Fixes: #22090, #23328
* cmake_path command: path managementMarc Chevrier2020-09-061-1/+18
| | | | Fixes: #19568, #20922
* STL Support: Add cm::filesystem::path in <cm/filesystem>Marc Chevrier2020-07-091-0/+10