diff --git a/CMakeLists.txt b/CMakeLists.txt index 6483a23..4fb7040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/test/filesystem_test.cpp b/test/filesystem_test.cpp index 3fac64c..f97f26e 100644 --- a/test/filesystem_test.cpp +++ b/test/filesystem_test.cpp @@ -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; } }