diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build index 8e0595cc323..8b1a043b7b9 100644 --- a/src/compiler/nir/meson.build +++ b/src/compiler/nir/meson.build @@ -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', diff --git a/src/compiler/nir/nir_stub.c b/src/compiler/nir/nir_stub.c new file mode 100644 index 00000000000..db62fafd07f --- /dev/null +++ b/src/compiler/nir/nir_stub.c @@ -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) +{ +}