nir: Only build nir headers for mediafoundation/d3d12-no-graphics paired build

Reviewed-by: <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34845>
This commit is contained in:
Sil Vilerino
2025-02-03 09:31:03 -05:00
committed by Marge Bot
parent 493b3fa661
commit 150fa795fe
2 changed files with 66 additions and 5 deletions
+36 -5
View File
@@ -76,7 +76,31 @@ nir_intrinsics_c = custom_target(
depend_files : files('nir_intrinsics.py'),
)
files_libnir = files(
with_nir_headers_only = (
gallium_drivers == ['d3d12'] and
get_option('gallium-d3d12-graphics').disabled() and
not [
with_gallium_vdpau,
with_gallium_va,
with_any_vk,
with_gallium_xa,
with_gallium_st_nine,
with_gallium_st_d3d10umd,
with_gallium_rusticl,
with_microsoft_clc,
with_spirv_to_dxil,
with_intel_clc,
with_clc,
with_drivers_clc,
get_option('intel-elk'),
with_tools.length() != 0,
].contains(true))
files_libnir = []
if with_nir_headers_only
files_libnir += files('nir_stub.c')
else
files_libnir += files(
'nir.c',
'nir.h',
'nir_builder.c',
@@ -309,7 +333,8 @@ files_libnir = files(
'nir_worklist.h',
'nir_xfb_info.h',
'nir_lower_atomics.c'
)
)
endif
# When a file is too large, -Wmisleading-indentation will give a note about
# not being able to process it, however that is not suppressable by a #pragma
@@ -321,11 +346,17 @@ if cc.get_id() == 'gcc'
no_misleading_indentation += cc.get_supported_arguments('-Wno-misleading-indentation')
endif
custom_targets_libnir = []
if not with_nir_headers_only
custom_targets_libnir += [nir_opt_algebraic_c, nir_opcodes_c,
nir_opcodes_h, nir_constant_expressions_c, nir_builder_opcodes_h,
nir_intrinsics_c, nir_intrinsics_h, nir_intrinsics_indices_h
]
endif
_libnir = static_library(
'nir',
[files_libnir, nir_opt_algebraic_c, nir_opcodes_c,
nir_opcodes_h, nir_constant_expressions_c, nir_builder_opcodes_h,
nir_intrinsics_c, nir_intrinsics_h, nir_intrinsics_indices_h],
[files_libnir, custom_targets_libnir],
include_directories : [inc_include, inc_src],
c_args : [c_msvc_compat_args, no_override_init_args, no_misleading_indentation],
gnu_symbol_visibility : 'hidden',
+30
View File
@@ -0,0 +1,30 @@
/*
* Copyright © Microsoft Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "nir.h"
#include "stdio.h"
void
nir_print_shader(nir_shader *shader, FILE *fp)
{
}