Avoid quoting OpenCL include path when it's not required to

pull/3186/head
Gabriele Gristina 2 years ago committed by Will Crozier
parent e5d441320d
commit 3156b487b7

@ -9392,22 +9392,23 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
char *build_options_buf = (char *) hcmalloc (build_options_sz);
int build_options_len = 0;
int build_options_len = snprintf (build_options_buf, build_options_sz, "-D KERNEL_STATIC ");
if ((device_param->is_cuda == true) || (device_param->is_hip == true))
{
// using a path with a space will break nvrtc_make_options_array_from_string()
// we add it to options array in a clean way later
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D KERNEL_STATIC ");
}
else
{
// when is builded with cygwin and msys, cpath_real doesn't work
#if defined (_WIN) || defined (__CYGWIN__) || defined (__MSYS__)
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D KERNEL_STATIC -D INCLUDE_PATH=%s ", "OpenCL");
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D INCLUDE_PATH=%s ", "OpenCL");
#else
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D KERNEL_STATIC -D INCLUDE_PATH=\"%s\" ", folder_config->cpath_real);
const char *build_options_include_fmt = (strchr (folder_config->cpath_real, ' ') != NULL) ? "-D INCLUDE_PATH=\"%s\" " : "-D INCLUDE_PATH=%s ";
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, build_options_include_fmt, folder_config->cpath_real);
#endif
build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D XM2S(x)=#x ");

Loading…
Cancel
Save