diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7d2ac65d88..21f285c2e5 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1991,8 +1991,13 @@ std::vector cmSystemTools::SplitEnvPathNormalized( std::string cmSystemTools::ToNormalizedPathOnDisk(std::string p) { using namespace cm::PathResolver; +#ifdef _WIN32 + // IWYU pragma: no_forward_declare cm::PathResolver::Policies::CasePath + static Resolver const resolver(RealOS); +#else // IWYU pragma: no_forward_declare cm::PathResolver::Policies::LogicalPath static Resolver const resolver(RealOS); +#endif resolver.Resolve(std::move(p), p); return p; }