summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-06-21 12:28:37 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-07-09 15:02:42 (GMT)
commitd654bf3449a24d412378af6c3aea53fa2899ad7d (patch)
tree7b5ac126f179e5513bbbc48fa03d3c598b02fec1 /Source
parente5798126fcfd08c7ca0f0f8d1fb627b04f655198 (diff)
downloadCMake-d654bf3449a24d412378af6c3aea53fa2899ad7d.zip
CMake-d654bf3449a24d412378af6c3aea53fa2899ad7d.tar.gz
CMake-d654bf3449a24d412378af6c3aea53fa2899ad7d.tar.bz2
STL Support: Add cm::filesystem::path in <cm/filesystem>
Diffstat (limited to 'Source')
-rw-r--r--Source/Checks/cm_cxx_features.cmake5
-rw-r--r--Source/Checks/cm_cxx_filesystem.cxx10
2 files changed, 15 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 50ccc7c..e726fc7 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -63,3 +63,8 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
endif()
cm_check_cxx_feature(unique_ptr)
+if (NOT CMAKE_CXX_STANDARD LESS "17")
+ cm_check_cxx_feature(filesystem)
+else()
+ set(CMake_HAVE_CXX_FILESYSTEM FALSE)
+endif()
diff --git a/Source/Checks/cm_cxx_filesystem.cxx b/Source/Checks/cm_cxx_filesystem.cxx
new file mode 100644
index 0000000..e508d1c
--- /dev/null
+++ b/Source/Checks/cm_cxx_filesystem.cxx
@@ -0,0 +1,10 @@
+
+#include <filesystem>
+
+int main()
+{
+ std::filesystem::path p1("/a/b/c");
+ std::filesystem::path p2("/a/b/c");
+
+ return p1 == p2 ? 0 : 1;
+}