Skip to content

Commit

Permalink
build: fix build with meson on riscv64 (#3773)
Browse files Browse the repository at this point in the history
RISC-V is a rising open-standarded RISC ISA. This commit makes mesonbuild
fallbacks to C implementation correctly on riscv64 platform instead of
throwing a "FIXME: unhandled CPU family" error.

Signed-off-by: Yao Zi <[email protected]>
  • Loading branch information
ziyao233 authored Aug 19, 2024
1 parent fa6d099 commit cea886e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions codec/common/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ elif cpu_family in ['loongarch32', 'loongarch64']
'loongarch/satd_sad_lasx.c',
]
cpp_sources += asm_sources
elif cpu_family == 'riscv64'
asm_sources = []
else
error('Unsupported cpu_family @0@'.format(cpu_family))
endif
Expand Down
2 changes: 2 additions & 0 deletions codec/decoder/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ elif cpu_family in ['loongarch32', 'loongarch64']
'core/loongarch/mb_aux_lsx.c',
]
cpp_sources += asm_sources
elif cpu_family == 'riscv64'
asm_sources = []
else
error('Unsupported cpu family @0@'.format(cpu_family))
endif
Expand Down
2 changes: 2 additions & 0 deletions codec/encoder/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ elif cpu_family in ['loongarch32', 'loongarch64']
'core/loongarch/sample_lasx.c',
]
cpp_sources += asm_sources
elif cpu_family == 'riscv64'
asm_sources = []
else
error('Unsupported cpu family @0@'.format(cpu_family))
endif
Expand Down
2 changes: 2 additions & 0 deletions codec/processing/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ elif cpu_family in ['loongarch32', 'loongarch64']
'src/loongarch/vaa_lasx.c',
]
cpp_sources += asm_sources
elif cpu_family == 'riscv64'
asm_sources = []
else
error('Unsupported cpu family @0@'.format(cpu_family))
endif
Expand Down
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ if ['linux', 'android', 'ios', 'darwin'].contains(system)
add_project_arguments('-mlsx', '-DHAVE_LSX', '-mlasx', '-DHAVE_LASX', language: 'c')
add_project_arguments('-DHAVE_LSX', '-DHAVE_LASX', language: 'cpp')
casm_inc = include_directories(join_paths('codec', 'common', 'loongarch'))
elif cpu_family == 'riscv64'
# We dont't have riscv64-specific optimization for now.
asm_format = asm_format64
else
error('FIXME: unhandled CPU family @0@ for @1@'.format(cpu_family, system))
endif
Expand Down

0 comments on commit cea886e

Please sign in to comment.