This repository was archived by the owner on Feb 15, 2024. It is now read-only.
File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,21 @@ add_subdirectory(compiler)
65
65
add_subdirectory (device_runtime)
66
66
67
67
if (FILE_REORG_BACKWARD_COMPATIBILITY)
68
+ # To enable disable #error in wrapper header files
69
+ if (NOT DEFINED ROCM_HEADER_WRAPPER_WERROR)
70
+ if (DEFINED ENV{ROCM_HEADER_WRAPPER_WERROR})
71
+ set (ROCM_HEADER_WRAPPER_WERROR "$ENV{ROCM_HEADER_WRAPPER_WERROR} "
72
+ CACHE STRING "Header wrapper warnings as errors." )
73
+ else ()
74
+ set (ROCM_HEADER_WRAPPER_WERROR "ON" CACHE STRING "Header wrapper warnings as errors." )
75
+ endif ()
76
+ endif ()
77
+ if (ROCM_HEADER_WRAPPER_WERROR)
78
+ set (deprecated_error 1)
79
+ else ()
80
+ set (deprecated_error 0)
81
+ endif ()
82
+
68
83
include (atmi-backward-compat.cmake)
69
84
endif ()
70
85
# make examples available in local build
Original file line number Diff line number Diff line change @@ -65,11 +65,18 @@ function(create_header_template)
65
65
#ifndef @include_guard@
66
66
#define @include_guard@
67
67
68
- #if defined(__GNUC__)
68
+ #ifndef ROCM_HEADER_WRAPPER_WERROR
69
+ #define ROCM_HEADER_WRAPPER_WERROR @deprecated_error@
70
+ #endif
71
+ #if ROCM_HEADER_WRAPPER_WERROR /* ROCM_HEADER_WRAPPER_WERROR 1 */
69
72
#error \" This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with atmi\"
73
+ #else /* ROCM_HEADER_WRAPPER_WERROR 0 */
74
+ #if defined(__GNUC__)
75
+ #warning \" This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with atmi\"
70
76
#else
71
77
#pragma message(\" This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with atmi\" )
72
78
#endif
79
+ #endif /* ROCM_HEADER_WRAPPER_WERROR */
73
80
74
81
@include_statements@
75
82
You can’t perform that action at this time.
0 commit comments