diff --git a/meson.build b/meson.build index ae90691222d..3c678a3cb92 100644 --- a/meson.build +++ b/meson.build @@ -44,6 +44,10 @@ with_mesa_debug = get_option('buildtype') == 'debug' # This means the final value of b_ndebug==true with_mesa_ndebug = get_option('b_ndebug') == 'true' or (get_option('buildtype') == 'release' and get_option('b_ndebug') == 'if-release') +# 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)] + # Arguments for the preprocessor, put these in a separate array from the C and # C++ (cpp in meson terminology) arguments since they need to be added to the # default arguments for both C and C++. diff --git a/src/asahi/libagx/meson.build b/src/asahi/libagx/meson.build index 070ad053d5b..f4a504ff3bf 100644 --- a/src/asahi/libagx/meson.build +++ b/src/asahi/libagx/meson.build @@ -13,9 +13,6 @@ libagx_shader_files = files( 'helper.cl', ) -# We need to set -fmacro-prefix-map properly for reproducability. -relative_dir = fs.relative_to(meson.global_source_root(), meson.global_build_root()) + '/' - libagx_spv = custom_target( input : libagx_shader_files, output : 'libagx.spv', @@ -26,7 +23,7 @@ libagx_spv = custom_target( '-I' + join_paths(meson.current_source_dir(), '../../'), '-I' + join_paths(meson.current_source_dir(), 'shaders'), '-I' + join_paths(meson.current_build_dir(), '../genxml'), - '-fmacro-prefix-map=@0@='.format(relative_dir), + cl_args, ], depends : [agx_pack], depfile : 'libagx_shaders.h.d', diff --git a/src/nouveau/vulkan/meson.build b/src/nouveau/vulkan/meson.build index e20384cd8fc..a04501a1b61 100644 --- a/src/nouveau/vulkan/meson.build +++ b/src/nouveau/vulkan/meson.build @@ -100,7 +100,7 @@ nvkcl_spv = custom_target( prog_mesa_clc, '-o', '@OUTPUT@', '--depfile', '@DEPFILE@', nvkcl_files, '--', '-I' + join_paths(meson.current_source_dir(), '.'), '-I' + join_paths(meson.project_source_root(), 'src'), - '-fmacro-prefix-map=@0@/='.format(relative_dir), + cl_args, ], depfile : '@PLAINNAME@.d', ) diff --git a/src/panfrost/libpan/meson.build b/src/panfrost/libpan/meson.build index af33c03a368..c58c2307da6 100644 --- a/src/panfrost/libpan/meson.build +++ b/src/panfrost/libpan/meson.build @@ -6,10 +6,6 @@ libpan_shader_files = files( 'query_pool.cl', ) -# We need to set -fmacro-prefix-map properly for reproducability. -fs = import('fs') -relative_dir = fs.relative_to(meson.global_source_root(), meson.global_build_root()) + '/' - idep_libpan_per_arch = {} foreach ver : ['4', '5', '6', '7', '9', '10'] @@ -25,7 +21,7 @@ foreach ver : ['4', '5', '6', '7', '9', '10'] '-I' + join_paths(meson.current_source_dir(), '../../'), '-I' + join_paths(meson.current_source_dir(), '../lib/'), '-I' + join_paths(meson.current_build_dir(), '../lib/'), - '-fmacro-prefix-map=@0@='.format(relative_dir), + cl_args, ], env: ['MESA_SHADER_CACHE_DISABLE=true'], depends : [pan_packers],