nak: Move the runner into the main nak crate

This makes the meson a bit simpler since we can just conditionally build
it based on #[cfg(test)] instead of breaking it into a separate library.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30402>
This commit is contained in:
Faith Ekstrand
2024-07-26 10:46:33 -05:00
committed by Marge Bot
parent ad90bf0500
commit 3e935df2b0
4 changed files with 9 additions and 21 deletions

View File

@@ -196,24 +196,6 @@ _libnak_rs = static_library(
# with the sanitizers because meson doesn't know to pass -fsanitize to the
# Rust linker. See also https://github.com/mesonbuild/meson/issues/11741
if with_tests and get_option('b_sanitize') == 'none'
_libnak_runner = static_library(
'nak_runner',
files('nak_runner/lib.rs'),
gnu_symbol_visibility : 'hidden',
rust_abi : 'rust',
rust_args : nak_rust_args,
dependencies : [
dep_libdrm,
idep_nouveau_ws,
idep_nvidia_headers_rs,
idep_nv_push_rs,
],
link_with: [
_libnak_bindings_rs,
_libnak_qmd_rs,
],
)
rust.test(
'nak',
_libnak_rs,
@@ -223,12 +205,15 @@ if with_tests and get_option('b_sanitize') == 'none'
],
suite : ['nouveau'],
dependencies : [
idep_mesautil.partial_dependency(link_args : true, links : true),
dep_libdrm,
idep_nouveau_ws,
idep_compiler.partial_dependency(link_args : true, links : true),
idep_mesautil.partial_dependency(link_args : true, links : true),
idep_nvidia_headers_rs,
idep_nv_push_rs,
],
link_with: [
_libacorn_rs,
_libnak_runner,
],
)
endif

View File

@@ -3,13 +3,13 @@
use crate::api::{GetDebugFlags, ShaderBin, DEBUG};
use crate::cfg::CFGBuilder;
use crate::hw_runner::{Runner, CB0};
use crate::ir::*;
use crate::sm50::ShaderModel50;
use crate::sm70::ShaderModel70;
use acorn::Acorn;
use nak_bindings::*;
use nak_runner::{Runner, CB0};
use std::str::FromStr;
use std::sync::OnceLock;

View File

@@ -33,3 +33,6 @@ mod union_find;
#[cfg(test)]
mod hw_tests;
#[cfg(test)]
mod hw_runner;