Skip to content

Commit 0a57cec

Browse files
authored
Merge pull request #212513 from Homebrew/x265-no-sve2
x265: disable SVE2 on arm64 Linux
2 parents 4eeb0bd + 03e2e57 commit 0a57cec

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

Formula/x/x265.rb

+19-14
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,39 @@ class X265 < Formula
2424
def install
2525
ENV.runtime_cpu_detection
2626
# Build based off the script at ./build/linux/multilib.sh
27-
args = std_cmake_args + %W[
27+
args = %W[
2828
-DLINKED_10BIT=ON
2929
-DLINKED_12BIT=ON
3030
-DEXTRA_LINK_FLAGS=-L.
3131
-DEXTRA_LIB=x265_main10.a;x265_main12.a
3232
-DCMAKE_INSTALL_RPATH=#{rpath}
3333
]
34-
high_bit_depth_args = std_cmake_args + %w[
34+
args << "-DENABLE_SVE2=OFF" if OS.linux? && Hardware::CPU.arm?
35+
high_bit_depth_args = %w[
3536
-DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF
3637
-DENABLE_SHARED=OFF -DENABLE_CLI=OFF
3738
]
39+
high_bit_depth_args << "-DENABLE_SVE2=OFF" if OS.linux? && Hardware::CPU.arm?
40+
3841
(buildpath/"8bit").mkpath
42+
system "cmake", "-S", buildpath/"source", "-B", "10bit",
43+
"-DENABLE_HDR10_PLUS=ON",
44+
*high_bit_depth_args,
45+
*std_cmake_args
46+
system "cmake", "--build", "10bit"
47+
mv "10bit/libx265.a", buildpath/"8bit/libx265_main10.a"
3948

40-
mkdir "10bit" do
41-
system "cmake", buildpath/"source", "-DENABLE_HDR10_PLUS=ON", *high_bit_depth_args
42-
system "make"
43-
mv "libx265.a", buildpath/"8bit/libx265_main10.a"
44-
end
49+
system "cmake", "-S", buildpath/"source", "-B", "12bit",
50+
"-DMAIN12=ON",
51+
*high_bit_depth_args,
52+
*std_cmake_args
53+
system "cmake", "--build", "12bit"
54+
mv "12bit/libx265.a", buildpath/"8bit/libx265_main12.a"
4555

46-
mkdir "12bit" do
47-
system "cmake", buildpath/"source", "-DMAIN12=ON", *high_bit_depth_args
48-
system "make"
49-
mv "libx265.a", buildpath/"8bit/libx265_main12.a"
50-
end
56+
system "cmake", "-S", buildpath/"source", "-B", "8bit", *args, *std_cmake_args
57+
system "cmake", "--build", "8bit"
5158

5259
cd "8bit" do
53-
system "cmake", buildpath/"source", *args
54-
system "make"
5560
mv "libx265.a", "libx265_main.a"
5661

5762
if OS.mac?

0 commit comments

Comments
 (0)