summaryrefslogtreecommitdiffstats
path: root/Source/Checks
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx_features.cmake5
-rw-r--r--Source/Checks/cm_cxx_make_unique.cxx6
-rw-r--r--Source/Checks/cm_cxx_unique_ptr.cxx6
3 files changed, 17 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 6fde7b6..c6a532f 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -32,8 +32,13 @@ function(cm_check_cxx_feature name)
endfunction()
if(CMAKE_CXX_STANDARD)
+ cm_check_cxx_feature(make_unique)
+ if(CMake_HAVE_CXX_MAKE_UNIQUE)
+ set(CMake_HAVE_CXX_UNIQUE_PTR 1)
+ endif()
cm_check_cxx_feature(nullptr)
cm_check_cxx_feature(override)
+ cm_check_cxx_feature(unique_ptr)
cm_check_cxx_feature(unordered_map)
cm_check_cxx_feature(unordered_set)
endif()
diff --git a/Source/Checks/cm_cxx_make_unique.cxx b/Source/Checks/cm_cxx_make_unique.cxx
new file mode 100644
index 0000000..a3ff68f
--- /dev/null
+++ b/Source/Checks/cm_cxx_make_unique.cxx
@@ -0,0 +1,6 @@
+#include <memory>
+int main()
+{
+ std::unique_ptr<int> u = std::make_unique<int>(0);
+ return *u;
+}
diff --git a/Source/Checks/cm_cxx_unique_ptr.cxx b/Source/Checks/cm_cxx_unique_ptr.cxx
new file mode 100644
index 0000000..a9d4ce5
--- /dev/null
+++ b/Source/Checks/cm_cxx_unique_ptr.cxx
@@ -0,0 +1,6 @@
+#include <memory>
+int main()
+{
+ std::unique_ptr<int> u(new int(0));
+ return *u;
+}