From 1e025e3e0a68a58308416093ea82038e7e9aea26 Mon Sep 17 00:00:00 2001 From: squidbus <1249084-squidbus@users.noreply.gitlab.freedesktop.org> Date: Fri, 12 Jun 2026 08:53:17 -0700 Subject: [PATCH] kk: Respect precomp-compiler options when setting up kk_clc --- src/kosmickrisp/clc/meson.build | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/kosmickrisp/clc/meson.build b/src/kosmickrisp/clc/meson.build index 7edd8c2ae68..e2037649d3c 100644 --- a/src/kosmickrisp/clc/meson.build +++ b/src/kosmickrisp/clc/meson.build @@ -2,12 +2,19 @@ # Copyright 2026 Google LLC # SPDX-License-Identifier: MIT -prog_kk_clc = executable( - 'kk_clc', - ['kk_clc.c'], - link_with : [libmsl_compiler], - include_directories : [inc_include, inc_src], - c_args : [pre_args, no_override_init_args], - link_args : [ld_args_build_id], - dependencies : [idep_vtn, idep_nir, idep_mesautil], -) \ No newline at end of file +if get_option('precomp-compiler') == 'system' + prog_kk_clc = find_program('kk_clc', native : true) +else + prog_kk_clc = executable( + 'kk_clc', + ['kk_clc.c'], + link_with : [libmsl_compiler], + include_directories : [inc_include, inc_src], + c_args : [pre_args, no_override_init_args], + link_args : [ld_args_build_id], + dependencies : [idep_vtn, idep_nir, idep_mesautil], + # If we can run host binaries directly, just build kk_clc for the host. + native : not meson.can_run_host_binaries(), + install : get_option('install-precomp-compiler'), + ) +endif \ No newline at end of file