From 8f441a8aff556ff02fb2f501a3df0377dd58d15d Mon Sep 17 00:00:00 2001 From: Scott Linder Date: Wed, 15 Jan 2020 15:54:04 -0500 Subject: [PATCH] Compile with -fshort-chars on Windows HIP requires a short wchar on Windows, and all compilation through Comgr on Windows now assumes the bitcode is compiled with a short wchar as well. This is the matching change to ensure this in the device-libs. Change-Id: Ifcf511bde8a5a198c42cb829af0c5283c11e61ed --- OCL.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OCL.cmake b/OCL.cmake index dde805a5..8f11f44c 100644 --- a/OCL.cmake +++ b/OCL.cmake @@ -27,6 +27,12 @@ set(CLANG_OCL_FLAGS -fcolor-diagnostics -Werror -Wno-error=atomic-alignment -x c -cl-std=CL2.0 -target "${AMDGPU_TARGET_TRIPLE}" -fvisibility=protected -fomit-frame-pointer -Xclang -finclude-default-header "${CLANG_OPTIONS_APPEND}") +# For compatibility with the MSVC headers we use a 32-bit wchar. Users linking +# against us must also use a short wchar. +if (WIN32) + set(CLANG_OCL_FLAGS ${CLANG_OCL_FLAGS} -fshort-wchar) +endif() + set (BC_EXT .bc) set (LIB_SUFFIX ".lib${BC_EXT}") set (STRIP_SUFFIX ".strip${BC_EXT}")