From 434a1719a3ffa5eb9085d8307c2c349a0e490cf6 Mon Sep 17 00:00:00 2001 From: Vlad Sytchenko Date: Mon, 15 Jun 2020 15:28:33 -0400 Subject: [PATCH] Enable the use of some warnings when building OCL-ROCclr Similar to http://gerrit-git.amd.com/c/compute/ec/vdi/+/375385, except no -Wno-strict-aliasing. With this change only one warning shows up during the build - -Wdeprecated-declarations in cltrace. Change-Id: Ie335eb9c45287ee1006e6bd65d54d67b41f79604 [ROCm/clr commit: ac3848a8e69cbbe968e1c24c568eeab0b6d55230] --- projects/clr/opencl/amdocl/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/clr/opencl/amdocl/CMakeLists.txt b/projects/clr/opencl/amdocl/CMakeLists.txt index 4f88cfe6bd..1805adffd3 100644 --- a/projects/clr/opencl/amdocl/CMakeLists.txt +++ b/projects/clr/opencl/amdocl/CMakeLists.txt @@ -24,8 +24,17 @@ include_directories(${CMAKE_SOURCE_DIR}/khronos) include_directories(${CMAKE_SOURCE_DIR}/khronos/headers) include_directories(${CMAKE_SOURCE_DIR}/khronos/headers/opencl2.2) -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options("-Wno-ignored-attributes") +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR + (CMAKE_${COMPILER}_COMPILER_ID MATCHES "Clang")) + add_definitions( + # Enabling -Wextra or -pedantic will cause + # thousands of warnings. Keep things simple for now. + -Wall + # This one seems impossible to fix for now. + # There are hundreds of instances of unused vars/functions + # throughout the code base. + -Wno-unused-variable + -Wno-unused-function) endif() if(UNIX)