mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-11 02:36:33 +08:00
refs #71, work on compilation issues on Windows
This commit is contained in:
parent
0282098c13
commit
45d36a8e19
@ -1,6 +1,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.7.2)
|
cmake_minimum_required(VERSION 3.7.2)
|
||||||
project(ghcfilesystem)
|
project(ghcfilesystem)
|
||||||
|
|
||||||
|
if(POLICY CMP0110)
|
||||||
|
cmake_policy(PUSH)
|
||||||
|
cmake_policy(SET CMP0110 OLD)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
|
|
||||||
cmake_dependent_option(GHC_FILESYSTEM_BUILD_TESTING
|
cmake_dependent_option(GHC_FILESYSTEM_BUILD_TESTING
|
||||||
@ -54,3 +59,6 @@ if(GHC_FILESYSTEM_WITH_INSTALL)
|
|||||||
install(EXPORT ghcFilesystemConfig NAMESPACE ghcFilesystem:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ghcFilesystem)
|
install(EXPORT ghcFilesystemConfig NAMESPACE ghcFilesystem:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ghcFilesystem)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(POLICY CMP0110)
|
||||||
|
cmake_policy(POP)
|
||||||
|
endif()
|
||||||
|
@ -2742,7 +2742,8 @@ TEST_CASE("Windows: Long filename support", "[filesystem][path][fs.path.win.long
|
|||||||
#ifdef GHC_OS_WINDOWS
|
#ifdef GHC_OS_WINDOWS
|
||||||
TemporaryDirectory t(TempOpt::change_path);
|
TemporaryDirectory t(TempOpt::change_path);
|
||||||
char c = 'A';
|
char c = 'A';
|
||||||
fs::path dir = "\\\\?\\" + fs::current_path().u8string();
|
fs::path dir{"\\\\?\\"};
|
||||||
|
dir += fs::current_path().u8string();
|
||||||
for (; c <= 'Z'; ++c) {
|
for (; c <= 'Z'; ++c) {
|
||||||
std::string part = std::string(16, c);
|
std::string part = std::string(16, c);
|
||||||
dir /= part;
|
dir /= part;
|
||||||
@ -2750,8 +2751,8 @@ TEST_CASE("Windows: Long filename support", "[filesystem][path][fs.path.win.long
|
|||||||
CHECK(fs::exists(dir));
|
CHECK(fs::exists(dir));
|
||||||
generateFile(dir / "f0");
|
generateFile(dir / "f0");
|
||||||
CHECK(fs::exists(dir / "f0"));
|
CHECK(fs::exists(dir / "f0"));
|
||||||
std::string native = dir.u8string();
|
auto native = dir.u8string();
|
||||||
if (native.substr(0, 4) == "\\\\?\\") {
|
if (native.substr(0, 4) == u8"\\\\?\\") {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user