meson,clc: set CL standard from meson

this is slightly less weird I think.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33879>
This commit is contained in:
Alyssa Rosenzweig 2025-03-04 12:48:04 -05:00 committed by Marge Bot
parent c0022b6603
commit 4d6e37066a
2 changed files with 9 additions and 7 deletions

View file

@ -46,7 +46,15 @@ with_mesa_ndebug = get_option('b_ndebug') == 'true' or (get_option('buildtype')
# We need to set -fmacro-prefix-map properly for driver CL reproducability.
relative_dir = fs.relative_to(meson.global_source_root(), meson.global_build_root())
cl_args = ['-fmacro-prefix-map=@0@/='.format(relative_dir)]
cl_args = [
'-fmacro-prefix-map=@0@/='.format(relative_dir),
# Set the OpenCL standard to CL 2.0, enabling everything at a frontend.
# Drivers may not actually support everything but that's ok.
'-cl-std=cl2.0',
'-D__OPENCL_VERSION__=200'
]
if with_mesa_ndebug
cl_args += ['-DNDEBUG']

View file

@ -88,12 +88,6 @@ main(int argc, char **argv)
util_dynarray_append(option ? &clang_args : &input_files, char *, arg);
}
/* Set the OpenCL standard to CL 2.0, this enables everything at a frontend
* level. See comment below about driver support.
*/
util_dynarray_append(&clang_args, char *, "-cl-std=cl2.0");
util_dynarray_append(&clang_args, char *, "-D__OPENCL_VERSION__=200");
if (util_dynarray_num_elements(&input_files, char *) == 0) {
fprintf(stderr, "No input file(s).\n");
print_usage(argv[0], stderr);