From 7e80d81b1e73d9d08de7c11d6ab55e7e44e048ed Mon Sep 17 00:00:00 2001 From: victzhan Date: Wed, 21 Jun 2023 15:51:59 -0400 Subject: [PATCH] SWDEV-404886 - Modified CMakeLists.txt for opencl to generate pdb files in release mode Change-Id: I2945144c3efb88c1045399cf1c33e4a82c53c0e6 [ROCm/clr commit: 134d6449b3c487677e87b2fd54ad026a16c6371c] --- projects/clr/hipamd/CMakeLists.txt | 6 ++++++ projects/clr/opencl/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/projects/clr/hipamd/CMakeLists.txt b/projects/clr/hipamd/CMakeLists.txt index a472c5b7a9..55cd58cd7e 100755 --- a/projects/clr/hipamd/CMakeLists.txt +++ b/projects/clr/hipamd/CMakeLists.txt @@ -50,6 +50,12 @@ option(HIP_OFFICIAL_BUILD "Enable/Disable for mainline/staging builds" OFF) if(NOT ENABLE_ASAN_PACKAGING) option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorg with backward compatibility" ON) endif() + +if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG:FULL") +endif() + set(HIPCC_BIN_DIR "" CACHE STRING "HIPCC and HIPCONFIG binary directories") if(__HIP_ENABLE_PCH) diff --git a/projects/clr/opencl/CMakeLists.txt b/projects/clr/opencl/CMakeLists.txt index bb3324a6b5..bd5e6a97a4 100644 --- a/projects/clr/opencl/CMakeLists.txt +++ b/projects/clr/opencl/CMakeLists.txt @@ -22,6 +22,12 @@ if(NOT ENABLE_ASAN_PACKAGING) option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorganization backward compatibility" ON) endif() +# Add flags to generate PDB files with full symbolic information +if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG:FULL") +endif() + set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/khronos/headers/opencl2.2" CACHE PATH "") if(BUILD_ICD) add_subdirectory(khronos/icd)