Skip to content

Commit c534d13

Browse files
seiko2pluscharris
authored andcommitted
BLD, BUG: Fix build failure for host flags e.g. -march=native on unsupported architectures
1 parent 51a0b9a commit c534d13

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

meson_cpu/meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ if host_machine.endian() == 'little' and cpu_family == 'ppc64'
9898
min_features = [VSX2]
9999
endif
100100

101-
# Used by build option 'max'
101+
# Used by build option 'max/native/detect'
102102
max_features_dict = {
103103
'x86': X86_FEATURES,
104104
'x86_64': X86_FEATURES,
@@ -111,6 +111,11 @@ max_features = []
111111
foreach fet_name, fet_obj : max_features_dict
112112
max_features += [fet_obj]
113113
endforeach
114+
if max_features.length() == 0
115+
message('Disabling CPU feature detection due to unsupported architecture: "' + cpu_family + '"')
116+
CPU_CONF_BASELINE = 'none'
117+
CPU_CONF_DISPATCH = 'none'
118+
endif
114119

115120
parse_options = {
116121
'cpu-baseline': CPU_CONF_BASELINE,

0 commit comments

Comments
 (0)