SWDEV-366831 - Wrapper header warning as error enabled with option flag
Change-Id: Ic923027cc20edff067044a6fe56a879c0ecddf7e
[ROCm/rocprofiler commit: ed96e9fbb6]
This commit is contained in:
@@ -261,8 +261,23 @@ install(
|
||||
option(FILE_REORG_BACKWARD_COMPATIBILITY
|
||||
"Enable File Reorg with backward compatibility" ON)
|
||||
if(FILE_REORG_BACKWARD_COMPATIBILITY)
|
||||
# To enabe/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(rocprofiler-backward-compat.cmake)
|
||||
endif()
|
||||
endif() #FILE_REORG_BACKWARD_COMPATIBILITY
|
||||
|
||||
if(${LIBRARY_TYPE} STREQUAL SHARED)
|
||||
# Packaging directives
|
||||
|
||||
@@ -52,11 +52,18 @@ function(create_header_template)
|
||||
#ifndef @include_guard@
|
||||
#define @include_guard@
|
||||
|
||||
#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 rocprofiler\"
|
||||
#else /* ROCM_HEADER_WRAPPER_WERROR 0 */
|
||||
#if defined(__GNUC__)
|
||||
#error \"This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with rocprofiler\"
|
||||
#else
|
||||
#pragma message(\"This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with rocprofiler\")
|
||||
#endif
|
||||
#endif /* ROCM_HEADER_WRAPPER_WERROR */
|
||||
|
||||
@include_statements@
|
||||
#endif")
|
||||
|
||||
Reference in New Issue
Block a user