2021-04-11 01:17:21 +01:00
|
|
|
# Copyright © 2018 Rob Clark
|
|
|
|
# Copyright © 2019 Collabora
|
|
|
|
|
|
|
|
# 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 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.
|
|
|
|
|
|
|
|
libasahi_agx_files = files(
|
|
|
|
'agx_compile.c',
|
2021-04-17 15:52:15 +01:00
|
|
|
'agx_dce.c',
|
2021-06-19 18:48:03 +01:00
|
|
|
'agx_liveness.c',
|
2022-04-17 21:47:37 +01:00
|
|
|
'agx_lower_parallel_copy.c',
|
2022-04-12 23:06:16 +01:00
|
|
|
'agx_lower_pseudo.c',
|
2021-04-12 04:49:30 +01:00
|
|
|
'agx_pack.c',
|
2021-04-11 03:03:19 +01:00
|
|
|
'agx_print.c',
|
2021-04-17 15:29:27 +01:00
|
|
|
'agx_optimizer.c',
|
2021-04-11 21:01:47 +01:00
|
|
|
'agx_register_allocate.c',
|
2021-04-17 21:59:51 +01:00
|
|
|
'agx_uniforms.c',
|
2022-04-19 02:32:50 +01:00
|
|
|
'agx_validate.c',
|
2021-04-11 01:17:21 +01:00
|
|
|
)
|
|
|
|
|
2021-04-16 00:08:13 +01:00
|
|
|
agx_opcodes_h = custom_target(
|
|
|
|
'agx_opcodes.h',
|
|
|
|
input : ['agx_opcodes.h.py'],
|
|
|
|
output : 'agx_opcodes.h',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
|
|
|
depend_files : files('agx_opcodes.py'),
|
|
|
|
)
|
|
|
|
|
|
|
|
idep_agx_opcodes_h = declare_dependency(
|
|
|
|
sources : [agx_opcodes_h],
|
|
|
|
include_directories : include_directories('.'),
|
|
|
|
)
|
|
|
|
|
2021-04-16 00:08:00 +01:00
|
|
|
agx_opcodes_c = custom_target(
|
|
|
|
'agx_opcodes.c',
|
|
|
|
input : ['agx_opcodes.c.py'],
|
|
|
|
output : 'agx_opcodes.c',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
|
|
|
depend_files : files('agx_opcodes.py'),
|
|
|
|
)
|
|
|
|
|
2021-04-16 00:08:26 +01:00
|
|
|
agx_builder_h = custom_target(
|
|
|
|
'agx_builder.h',
|
|
|
|
input : ['agx_builder.h.py'],
|
|
|
|
output : 'agx_builder.h',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
|
|
|
depend_files : files('agx_opcodes.py'),
|
|
|
|
)
|
|
|
|
|
|
|
|
idep_agx_builder_h = declare_dependency(
|
|
|
|
sources : [agx_builder_h],
|
|
|
|
include_directories : include_directories('.'),
|
|
|
|
)
|
|
|
|
|
2021-04-11 01:17:21 +01:00
|
|
|
libasahi_compiler = static_library(
|
|
|
|
'asahi_compiler',
|
2021-04-11 03:03:19 +01:00
|
|
|
[libasahi_agx_files, agx_opcodes_c],
|
2021-04-11 01:17:21 +01:00
|
|
|
include_directories : [inc_include, inc_src, inc_mesa, inc_gallium, inc_gallium_aux, inc_mapi],
|
2021-07-06 14:41:15 +01:00
|
|
|
dependencies: [idep_nir, idep_agx_opcodes_h, idep_agx_builder_h, idep_agx_pack],
|
2021-04-11 01:17:21 +01:00
|
|
|
c_args : [no_override_init_args],
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
|
|
|
build_by_default : false,
|
|
|
|
)
|
2022-04-12 23:06:13 +01:00
|
|
|
|
|
|
|
if with_tests
|
|
|
|
test(
|
|
|
|
'agx_tests',
|
|
|
|
executable(
|
|
|
|
'agx_tests',
|
|
|
|
files(
|
2022-07-31 18:16:52 +01:00
|
|
|
'test/test-minifloat.cpp',
|
2022-04-12 23:06:13 +01:00
|
|
|
'test/test-optimizer.cpp',
|
2022-04-12 23:06:16 +01:00
|
|
|
'test/test-lower-pseudo.cpp',
|
2022-04-14 04:09:29 +01:00
|
|
|
'test/test-lower-parallel-copy.cpp',
|
2022-04-12 23:06:13 +01:00
|
|
|
),
|
|
|
|
c_args : [c_msvc_compat_args, no_override_init_args],
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
|
|
|
include_directories : [inc_include, inc_src, inc_mesa],
|
|
|
|
dependencies: [idep_gtest, idep_nir, idep_agx_opcodes_h, idep_agx_builder_h],
|
|
|
|
link_with : [libasahi_compiler],
|
|
|
|
),
|
|
|
|
suite : ['asahi'],
|
|
|
|
protocol : gtest_test_protocol,
|
|
|
|
)
|
|
|
|
endif
|