Skip to content

Commit

Permalink
refs #71, work on compilation issues on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Dec 28, 2020
1 parent 0282098 commit 45d36a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
7 changes: 4 additions & 3 deletions test/filesystem_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2742,16 +2742,17 @@ 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;
CHECK_NOTHROW(fs::create_directory(dir));
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;
}
}
Expand Down

0 comments on commit 45d36a8

Please sign in to comment.