Skip to content

Commit 11eb58e

Browse files
Fix clang debug build (#2)
* Enable debug build on Windows with ROCm * fixed clang flag for debug config * fixed compiler flags for debug windows vs linux --------- Co-authored-by: Michal Gallus <[email protected]>
1 parent b773f80 commit 11eb58e

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

cmake/Dependencies.cmake

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,11 +1288,25 @@ if(USE_ROCM)
12881288
message("TORCH_HIP_VERSION=${TORCH_HIP_VERSION} is added as a compiler defines")
12891289

12901290
if(CMAKE_BUILD_TYPE MATCHES Debug)
1291-
list(APPEND HIP_CXX_FLAGS -g2)
1292-
list(APPEND HIP_CXX_FLAGS -O0)
1293-
list(APPEND HIP_HIPCC_FLAGS -fdebug-info-for-profiling)
1291+
if(WIN32)
1292+
list(APPEND HIP_CXX_FLAGS -g)
1293+
else()
1294+
list(APPEND HIP_CXX_FLAGS -g2)
1295+
endif()
1296+
list(APPEND HIP_CXX_FLAGS -O0)
1297+
list(APPEND HIP_HIPCC_FLAGS -fdebug-info-for-profiling)
12941298
endif(CMAKE_BUILD_TYPE MATCHES Debug)
12951299

1300+
if(WIN32)
1301+
if(CMAKE_BUILD_TYPE MATCHES Debug)
1302+
list(APPEND HIP_CXX_FLAGS -fms-runtime-lib=dll_dbg)
1303+
list(APPEND HIP_HIPCC_FLAGS -fms-runtime-lib=dll_dbg)
1304+
else()
1305+
list(APPEND HIP_CXX_FLAGS -fms-runtime-lib=dll)
1306+
list(APPEND HIP_HIPCC_FLAGS -fms-runtime-lib=dll)
1307+
endif()
1308+
endif()
1309+
12961310
set(HIP_CLANG_FLAGS ${HIP_CXX_FLAGS})
12971311
# Ask hcc to generate device code during compilation so we can use
12981312
# host linker to link.

0 commit comments

Comments
 (0)