Skip to content

Commit 94b3a29

Browse files
committed
fix cross compilation
1 parent 648cf4c commit 94b3a29

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

externals/cgns/hdf5/meson.build

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ else
1515
endif
1616

1717
cc = meson.get_compiler('c')
18+
# Check if can run tests
19+
cc_can_run = not meson.is_cross_build() or meson.has_exe_wrapper()
20+
1821

1922
hdf5_conf_data = configuration_data()
2023
hdf5_conf_data.set('version', '1.12.1')
@@ -393,7 +396,7 @@ int main ()
393396
'''
394397

395398
result = cc.compiles(code_dev_t, name : 'check dev_t')
396-
if result
399+
if result and cc_can_run
397400
result_dev = cc.run(code_dev_t, name : 'check dev_t scalar')
398401
hdf5_conf_data.set('H5_DEV_T_IS_SCALAR', result_dev.returncode())
399402
else
@@ -573,7 +576,7 @@ int main ()
573576
}
574577
'''
575578
result = cc.compiles(code_ioeo, name : 'check ioeo')
576-
if result
579+
if result and cc_can_run
577580
result_ioeo = cc.run(code_ioeo, name : 'check ioeo works')
578581
hdf5_conf_data.set('H5_HAVE_IOEO', result_ioeo.returncode())
579582
else

0 commit comments

Comments
 (0)