@@ -155,20 +155,17 @@ BEGIN
155
155
if ($isWindows ) {
156
156
$execExtension = " .exe" ;
157
157
}
158
- $HIPCC =" $HIP_CLANG_PATH /clang++" . $execExtension ;
158
+ $HIPCC =" \" $HIP_CLANG_PATH /clang++" . $execExtension . " \" " ;
159
159
160
160
# If $HIPCC clang++ is not compiled, use clang instead
161
161
if ( ! -e $HIPCC ) {
162
- $HIPCC =" $HIP_CLANG_PATH /clang" . $execExtension ;
162
+ $HIPCC =" \" $HIP_CLANG_PATH /clang" . $execExtension . " \" " ;
163
163
$HIPLDFLAGS = " --driver-mode=g++" ;
164
164
}
165
165
# to avoid using dk linker or MSVC linker
166
166
if ($isWindows ) {
167
167
$HIPLDFLAGS .= " -fuse-ld=lld" ;
168
- $HIPLDFLAGS .= " --ld-path=$HIP_CLANG_PATH /lld-link.exe" ;
169
-
170
- # escape possible spaces in path name
171
- $HIPCC =~ s /\s / \\ $& / g ;
168
+ $HIPLDFLAGS .= " --ld-path=\" $HIP_CLANG_PATH /lld-link.exe\" " ;
172
169
}
173
170
174
171
# get Clang RT Builtin path
@@ -204,12 +201,12 @@ BEGIN
204
201
print (" CUDA_PATH=$CUDA_PATH \n " );
205
202
}
206
203
207
- $HIPCC =" $CUDA_PATH /bin/nvcc" ;
204
+ $HIPCC =" \" $CUDA_PATH /bin/nvcc\" " ;
208
205
$HIPCXXFLAGS .= " -Wno-deprecated-gpu-targets " ;
209
- $HIPCXXFLAGS .= " -isystem $CUDA_PATH /include" ;
210
- $HIPCFLAGS .= " -isystem $CUDA_PATH /include" ;
206
+ $HIPCXXFLAGS .= " -isystem \" $CUDA_PATH /include\" " ;
207
+ $HIPCFLAGS .= " -isystem \" $CUDA_PATH /include\" " ;
211
208
212
- $HIPLDFLAGS = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L$CUDA_PATH /lib64" ;
209
+ $HIPLDFLAGS = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L\" $CUDA_PATH /lib64\" " ;
213
210
} else {
214
211
printf (" error: unknown HIP_PLATFORM = '$HIP_PLATFORM '" );
215
212
printf (" or HIP_COMPILER = '$HIP_COMPILER '" );
@@ -469,10 +466,7 @@ BEGIN
469
466
if (not $isWindows and $escapeArg ) {
470
467
$arg =~ s / [^-a-zA-Z0-9_=+,.\/ ]/ \\ $& / g ;
471
468
}
472
- if ($isWindows and $escapeArg ) {
473
- $arg =~ s / [^-a-zA-Z0-9_=+,.:\/\\ ]/ \\ $& / g ;
474
- }
475
- $toolArgs .= " $arg " unless $swallowArg ;
469
+ $toolArgs .= " \" $arg \" " unless $swallowArg ;
476
470
$prevArg = $arg ;
477
471
}
478
472
0 commit comments