refs #71, work on compilation issues on Windows

This commit is contained in:
Steffen Schuemann 2020-12-28 01:07:16 +01:00
parent 0282098c13
commit 45d36a8e19
2 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.7.2)
project(ghcfilesystem)
if(POLICY CMP0110)
cmake_policy(PUSH)
cmake_policy(SET CMP0110 OLD)
endif()
include(CMakeDependentOption)
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)
endif()
if(POLICY CMP0110)
cmake_policy(POP)
endif()

View File

@ -2742,7 +2742,8 @@ TEST_CASE("Windows: Long filename support", "[filesystem][path][fs.path.win.long
#ifdef GHC_OS_WINDOWS
TemporaryDirectory t(TempOpt::change_path);
char c = 'A';
fs::path dir = "\\\\?\\" + fs::current_path().u8string();
fs::path dir{"\\\\?\\"};
dir += fs::current_path().u8string();
for (; c <= 'Z'; ++c) {
std::string part = std::string(16, c);
dir /= part;
@ -2750,8 +2751,8 @@ TEST_CASE("Windows: Long filename support", "[filesystem][path][fs.path.win.long
CHECK(fs::exists(dir));
generateFile(dir / "f0");
CHECK(fs::exists(dir / "f0"));
std::string native = dir.u8string();
if (native.substr(0, 4) == "\\\\?\\") {
auto native = dir.u8string();
if (native.substr(0, 4) == u8"\\\\?\\") {
break;
}
}