summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2017-12-12 12:22:56 -0800
committerDylan Baker <[email protected]>2018-01-11 15:40:02 -0800
commit2083a14179eb04d22feebc5751a1a145828d07cf (patch)
tree0fa3d2d540621d00faa6daf0c132aa5127f2dab0 /src/compiler
parent60856a7b4982aaaa4f22a002878d5d78cd63e272 (diff)
meson: Use dependencies for nir
This creates two new internal dependencies, idep_nir_headers and idep_nir. The former encapsulates the generation of nir_opcodes.h and nir_builder_opcodes.h and adding src/compiler/nir as an include path. This ensures that any target that needs nir headers will have the includes and that the generated headers will be generated before the target is build. The second, idep_nir, includes the first and additionally links to libnir. This is intended to make it easier to avoid race conditions in the build when using nir, since the number of consumers for libnir and it's headers are quite high. Acked-by: Eric Engestrom <[email protected]> Signed-off-by: Dylan Baker <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/meson.build3
-rw-r--r--src/compiler/meson.build4
-rw-r--r--src/compiler/nir/meson.build18
3 files changed, 19 insertions, 6 deletions
diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build
index 2a6bddf4a84..b0c0de810a6 100644
--- a/src/compiler/glsl/meson.build
+++ b/src/compiler/glsl/meson.build
@@ -205,8 +205,9 @@ libglsl = static_library(
ir_expression_operation_strings_h, ir_expression_operation_constant_h],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
- link_with : [libnir, libglcpp],
+ link_with : libglcpp,
include_directories : [inc_common, inc_compiler, inc_nir],
+ dependencies : idep_nir,
build_by_default : false,
)
diff --git a/src/compiler/meson.build b/src/compiler/meson.build
index 783be11c926..d86bdde61d8 100644
--- a/src/compiler/meson.build
+++ b/src/compiler/meson.build
@@ -58,9 +58,9 @@ subdir('nir')
spirv2nir = executable(
'spirv2nir',
[files('spirv/spirv2nir.c'), dummy_cpp],
- dependencies : [dep_m, dep_thread],
+ dependencies : [dep_m, dep_thread, idep_nir],
include_directories : [inc_common, inc_nir, include_directories('spirv')],
- link_with : [libnir, libmesa_util],
+ link_with : libmesa_util,
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
build_by_default : false,
)
diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build
index 54cef67e9e0..b5f27ad667b 100644
--- a/src/compiler/nir/meson.build
+++ b/src/compiler/nir/meson.build
@@ -205,6 +205,18 @@ libnir = static_library(
build_by_default : false,
)
+# Headers-only dependency
+idep_nir_headers = declare_dependency(
+ sources : [nir_opcodes_h, nir_builder_opcodes_h],
+ include_directories : include_directories('.'),
+)
+
+# Also link with nir
+idep_nir = declare_dependency(
+ dependencies : idep_nir_headers,
+ link_with : libnir,
+)
+
nir_algebraic_py = files('nir_algebraic.py')
if with_tests
@@ -212,11 +224,11 @@ if with_tests
'nir_control_flow',
executable(
'nir_control_flow_test',
- [files('tests/control_flow_tests.cpp'), nir_opcodes_h],
+ files('tests/control_flow_tests.cpp'),
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
include_directories : [inc_common],
- dependencies : [dep_thread, idep_gtest],
- link_with : [libmesa_util, libnir],
+ dependencies : [dep_thread, idep_gtest, idep_nir],
+ link_with : libmesa_util,
)
)
endif