SWDEV-366831 - Compile time flag to switch between #warning and #error message
Using backward compatibility paths will provide an #error message. Compile time option added to enable/disable the #error message.
Disabling the same will provide a #warning message
Change-Id: I6abc236e810ccc38d3636074e0e8f5a9657c2e9a
[ROCm/roctracer commit: ea061be2d1]
This commit is contained in:
@@ -23,11 +23,18 @@
|
|||||||
#ifndef @include_guard@
|
#ifndef @include_guard@
|
||||||
#define @include_guard@
|
#define @include_guard@
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#ifndef ROCM_HEADER_WRAPPER_WERROR
|
||||||
|
#define ROCM_HEADER_WRAPPER_WERROR @deprecated_error@
|
||||||
|
#endif
|
||||||
|
#if ROCM_HEADER_WRAPPER_WERROR /* ROCM_HEADER_WRAPPER_WERROR 1 */
|
||||||
#error "This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with roctracer"
|
#error "This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with roctracer"
|
||||||
|
#else /* ROCM_HEADER_WRAPPER_WERROR 0 */
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#warning "This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with roctracer"
|
||||||
#else
|
#else
|
||||||
#pragma message("This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with roctracer")
|
#pragma message("This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with roctracer")
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* ROCM_HEADER_WRAPPER_WERROR */
|
||||||
|
|
||||||
@include_statements@
|
@include_statements@
|
||||||
|
|
||||||
|
|||||||
@@ -247,5 +247,19 @@ if(NOT ENABLE_ASAN_PACKAGING)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(FILE_REORG_BACKWARD_COMPATIBILITY)
|
if(FILE_REORG_BACKWARD_COMPATIBILITY)
|
||||||
|
## To enable/disable #error in wrapper header files
|
||||||
|
if(NOT DEFINED ROCM_HEADER_WRAPPER_WERROR)
|
||||||
|
if(DEFINED ENV{ROCM_HEADER_WRAPPER_WERROR})
|
||||||
|
set(ROCM_HEADER_WRAPPER_WERROR "$ENV{ROCM_HEADER_WRAPPER_WERROR}"
|
||||||
|
CACHE STRING "Header wrapper warnings as errors.")
|
||||||
|
else()
|
||||||
|
set(ROCM_HEADER_WRAPPER_WERROR "ON" CACHE STRING "Header wrapper warnings as errors.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(ROCM_HEADER_WRAPPER_WERROR)
|
||||||
|
set(deprecated_error 1)
|
||||||
|
else()
|
||||||
|
set(deprecated_error 0)
|
||||||
|
endif()
|
||||||
include(${PROJECT_SOURCE_DIR}/roctracer-backward-compat.cmake)
|
include(${PROJECT_SOURCE_DIR}/roctracer-backward-compat.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user