aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJuan Ramos <[email protected]>2023-01-04 15:57:00 -0700
committerJuan Ramos <[email protected]>2023-01-05 09:09:15 -0700
commit18963a6cc03fe15e3785d353dea6a1ff95115a5e (patch)
treeed640211f3daecd7614f412912cf09ba3044007d
parent24115c70bea4bb91e7bd12ef093fbdf6aa9a5222 (diff)
downloadVulkan-Headers-18963a6cc03fe15e3785d353dea6a1ff95115a5e.tar.gz
Vulkan-Headers-18963a6cc03fe15e3785d353dea6a1ff95115a5e.zip
Deprecate vk_sdk_platform.h
closes #316
-rw-r--r--include/vulkan/vk_sdk_platform.h14
-rw-r--r--tests/CMakeLists.txt1
2 files changed, 15 insertions, 0 deletions
diff --git a/include/vulkan/vk_sdk_platform.h b/include/vulkan/vk_sdk_platform.h
index 9c567a2..3bdf505 100644
--- a/include/vulkan/vk_sdk_platform.h
+++ b/include/vulkan/vk_sdk_platform.h
@@ -20,6 +20,20 @@
*/
#pragma once
+// Allow users to suppress warnings generated by this header file by defining VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING
+#ifndef VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING
+
+#if defined(__GNUC__) && __GNUC__ >= 4
+#warning "vk_sdk_platform.h is deprecated and will be removed in future release! Use VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING to suppress warning!"
+#endif
+
+// MSVC doesn't support warning directive
+#if defined(_MSC_VER)
+#pragma message("vk_sdk_platform.h is deprecated and will be removed in future release! Use VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING to suppress warning!")
+#endif
+
+#endif
+
#if defined(_WIN32)
#ifndef NOMINMAX
#define NOMINMAX
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 777ac99..2d2a3ce 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -42,3 +42,4 @@ target_link_libraries(vk_layer PRIVATE Vulkan::Headers)
# vk_sdk_platform.h
add_executable(vk_sdk_platform vk_sdk_platform.c)
target_link_libraries(vk_sdk_platform PRIVATE Vulkan::Headers)
+target_compile_definitions(vk_sdk_platform PRIVATE VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING)