FindFilesystem: Eliminate Win32 warning

Using `printf("%s")` with a `std::filesystem::path` on Win32 will
cause a compile warning, because `std::filesystem::path::value_type`
is technically `wchar_t`.

The warning is harmless, but by using iostream to print the value
on `std::cout` instead, the code compiles without warnings.
This commit is contained in:
FeRD (Frank Dana)
2023-01-15 12:54:17 -05:00
parent affdd497ec
commit 0bf4ef711e
+2 -2
View File
@@ -197,12 +197,12 @@ set(_found FALSE)
if(CXX_FILESYSTEM_HAVE_FS)
# We have some filesystem library available. Do link checks
string(CONFIGURE [[
#include <cstdlib>
#include <iostream>
#include <@CXX_FILESYSTEM_HEADER@>
int main() {
auto cwd = @CXX_FILESYSTEM_NAMESPACE@::current_path();
printf("%s", cwd.c_str());
std::cout << cwd << std::endl;
return EXIT_SUCCESS;
}
]] code @ONLY)