Skip to content

Commit 1cfe5d4

Browse files
authored
Merge pull request #16 from sailfishos/jb58368_prjconf_armv7
Allow prjconf to disable the building of the armv7/aarch64 builds.
2 parents d2ffdf2 + fbb0bfe commit 1cfe5d4

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

rust.spec

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,25 @@
3232
%endif
3333
%endif
3434

35+
# The prjconf can override the "enabled by default" by setting
36+
# rust_disable_armv7 to 1
37+
%define build_armv7 %{?rust_disable_armv7:0}%{!?rust_disable_armv7:1}
38+
%define build_aarch64 %{?rust_disable_aarch64:0}%{!?rust_disable_aarch64:1}
39+
40+
%if 0%{?build_armv7}
3541
%global rust_arm_triple armv7-unknown-linux-gnueabihf
42+
%define rust_arm_triple_comma ,%{rust_arm_triple}
43+
%else
44+
%define rust_arm_triple_comma ""
45+
%endif
46+
%if 0%{?build_aarch64}
3647
%global rust_aarch64_triple aarch64-unknown-linux-gnu
48+
%define rust_aarch64_triple_comma ,%{rust_aarch64_triple}
49+
%else
50+
%define rust_aarch64_triple_comma ""
51+
%endif
3752
%global rust_x86_triple i686-unknown-linux-gnu
3853

39-
%define build_armv7 1
40-
%define build_aarch64 1
41-
4254
%global python python3
4355

4456
# LLDB isn't available everywhere...
@@ -296,11 +308,7 @@ PATH=/opt/cross/bin/:$PATH
296308
--disable-option-checking \
297309
--libdir=%{common_libdir} \
298310
--build=%{rust_x86_triple} --host=%{rust_x86_triple}\
299-
%if 0%{?build_aarch64}
300-
--target=%{rust_x86_triple},%{rust_arm_triple}\,%{rust_aarch64_triple}\
301-
%else
302-
--target=%{rust_x86_triple},%{rust_arm_triple}\
303-
%endif
311+
--target=%{rust_x86_triple}%{rust_arm_triple_comma}%{rust_aarch64_triple_comma}\
304312
--python=%{python} \
305313
--local-rust-root=%{local_rust_root} \
306314
--enable-local-rebuild \

0 commit comments

Comments
 (0)