mirror of
https://github.com/ashaduri/gsmartcontrol.git
synced 2026-09-25 13:25:37 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user