From 907652e1ed3c95e3fdb1620cec4d5a1034153398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 27 Mar 2020 23:19:36 +0200 Subject: [PATCH] Extend the configure test for C++17 filesystem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If recent versions of libc++ are built with filesystem support disabled, the filesystem header still is installed., The std::filesystem::path() constructor is completely defined inline in that header, making the test pass on such configurations, despite C++17 filesystem not being implemented. Test a call to std::filesystem::copy instead, which requires the actual library implementation to be available as well (on recent libc++). Change-Id: Id997ab75f3299d8431b13cad871f2901f4d9f6ed Reviewed-by: MÃ¥rten Nordheim --- src/corelib/configure.cmake | 4 +++- src/corelib/configure.json | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index eaeb7862c4..679346188e 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -165,7 +165,9 @@ int main(int argc, char **argv) { (void)argc; (void)argv; /* BEGIN TEST: */ -std::filesystem::path p(\"./file\"); +std::filesystem::copy( + std::filesystem::path("./file"), + std::filesystem::path("./other")); /* END TEST: */ return 0; } diff --git a/src/corelib/configure.json b/src/corelib/configure.json index a8efaa509c..4225574761 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -371,7 +371,11 @@ "type": "compile", "test": { "include": "filesystem", - "main": "std::filesystem::path p(\"./file\");", + "main": [ + "std::filesystem::copy(", + " std::filesystem::path(\"./file\"),", + " std::filesystem::path(\"./other\"));" + ], "qmake": "CONFIG += c++17" } },