About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/frygon/compiler/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'src/frygon/compiler/meson.build')
-rw-r--r--src/frygon/compiler/meson.build107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/frygon/compiler/meson.build b/src/frygon/compiler/meson.build
new file mode 100644
index 00000000000..378d7c41e8f
--- /dev/null
+++ b/src/frygon/compiler/meson.build
@@ -0,0 +1,107 @@
+# Copyright © 2025 Lucas Francisco Fryzek
+# SPDX-License-Identifier: MIT
+
+fgcc_rust_args = [
+ rust_2024_lint_args,
+ '-Aclippy::identity_op',
+ '-Aclippy::len_zero',
+ '-Aclippy::manual_range_contains',
+ # normally this is a good one, but we use it where the "better" code is worse
+ '-Aclippy::needless_range_loop',
+ '-Aclippy::redundant_field_names',
+ '-Aclippy::upper_case_acronyms',
+ '-Aclippy::vec_box',
+ '-Aclippy::write_with_newline',
+ # warns about public function might dereference a raw pointer, but nothing is
+ # actually public here
+ '-Aclippy::not_unsafe_ptr_arg_deref',
+ '-Anon_snake_case',
+]
+
+libfgcc_c_files = files(
+ 'fgcc.h',
+ 'fgcc_nir.c',
+)
+
+libfgcc_deps = [
+ idep_mesautil,
+ idep_nir_headers,
+ idep_fg_headers,
+]
+
+_fgcc_bindings_rs = rust.bindgen(
+ input : ['fgcc_bindings.h'],
+ output : 'fgcc_bindings.rs',
+ c_args : [
+ pre_args,
+ ],
+ args : [
+ bindgen_output_args,
+ compiler_rs_bindgen_blocklist,
+ '--raw-line', 'use compiler::bindings::*;',
+ #'--allowlist-type', 'drm.*',
+ '--allowlist-type', 'fgcc_.*',
+ #'--allowlist-type', 'nouveau_ws_.*',
+ #'--allowlist-var', 'DRM_.*',
+ '--allowlist-var', 'FGCC_.*',
+ #'--allowlist-var', 'NVIDIA_VENDOR_ID',
+ #'--allowlist-function', 'drm.*',
+ '--allowlist-function', 'fgcc_.*',
+ #'--allowlist-function', 'nouveau_ws_.*',
+ # provided through compiler::bindings::*
+ '--blocklist-type', 'glsl_.*',
+ '--no-prepend-enum-name',
+ '--with-derive-default',
+ ],
+ dependencies : [
+ dep_libdrm,
+ libfgcc_deps,
+ ],
+)
+
+_libfgcc_bindings_rs = static_library(
+ 'fgcc_bindings',
+ _fgcc_bindings_rs,
+ gnu_symbol_visibility : 'hidden',
+ dependencies : [
+ idep_compiler_rs,
+ ],
+ rust_abi : 'rust',
+)
+
+_libfgcc_rs = static_library(
+ 'fgcc_rs',
+ files('fgcc/lib.rs'),
+ gnu_symbol_visibility : 'hidden',
+ rust_abi : 'c',
+ rust_args : [
+ fgcc_rust_args,
+ # Otherwise, rustc trips up on -pthread
+ '-Clink-arg=-Wno-unused-command-line-argument',
+ ],
+ dependencies : [
+ #dep_paste,
+ #dep_rustc_hash,
+ #idep_bitview_rs,
+ idep_compiler_rs,
+ ],
+ link_with : [
+ _libfgcc_bindings_rs,
+ #_libnak_ir_proc_rs,
+ ],
+)
+
+_libfgcc = static_library(
+ 'fgcc',
+ [libfgcc_c_files],
+ include_directories: [inc_include, inc_src, inc_gallium],
+ dependencies : libfgcc_deps,
+ link_with : [_libfgcc_rs],
+ c_args : [no_override_init_args],
+ gnu_symbol_visibility : 'hidden',
+)
+
+idep_fgcc = declare_dependency(
+ include_directories : include_directories('.'),
+ link_with : _libfgcc,
+)