Skip to content

Commit 540366f

Browse files
committed
use target_machine instead of build_machine for cross compilation
1 parent 2940367 commit 540366f

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

externals/cgns/hdf5/meson.build

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if build_machine.system() == 'windows' or meson.get_compiler('c').get_id() == 'intel'
1+
if target_machine.system() == 'windows' or meson.get_compiler('c').get_id() == 'intel'
22
hdf5_default_warnings = []
33
else
44
hdf5_default_warnings = ['-Wno-unused-result',
@@ -46,7 +46,7 @@ if opt_szip.found()
4646
endif
4747

4848

49-
if build_machine.system() == 'windows'
49+
if target_machine.system() == 'windows'
5050
hdf5_conf_data.set('H5_HAVE_WINDOWS', 1)
5151
hdf5_conf_data.set('H5_HAVE_WINDOW_PATH', 1)
5252
hdf5_conf_data.set('H5_HAVE_MINGW', 1)
@@ -66,22 +66,22 @@ if build_machine.system() == 'windows'
6666
hdf5_conf_data.set('H5_HAVE_LIBWSOCK32', 1)
6767
endif
6868

69-
if build_machine.system() != 'windows'
70-
if build_machine.endian() == 'big'
69+
if target_machine.system() != 'windows'
70+
if target_machine.endian() == 'big'
7171
hdf5_conf_data.set('H5_WORDS_BIGENDIAN', 1)
7272
else
7373
hdf5_conf_data.set('H5_WORDS_BIGENDIAN', 0)
7474
endif
7575
endif
7676

7777

78-
if build_machine.system() == 'windows'
78+
if target_machine.system() == 'windows'
7979
hdf5_conf_data.set('H5_DEFAULT_PLUGINDIR', '%ALLUSERSPROFILE%\\\\hdf5\\\\lib\\\\plugin')
8080
else
8181
hdf5_conf_data.set('H5_DEFAULT_PLUGINDIR', '/usr/local/hdf5/lib/plugin')
8282
endif
8383

84-
if build_machine.system()=='darwin'
84+
if target_machine.system()=='darwin'
8585
hdf5_conf_data.set('H5_HAVE_DARWIN', 1)
8686
endif
8787

@@ -147,7 +147,7 @@ if cc.has_header('io.h')
147147
hdf5_conf_data.set('H5_HAVE_IO_H', 1)
148148
endif
149149

150-
if build_machine.system() != 'windows'
150+
if target_machine.system() != 'windows'
151151
hdf5_conf_data.set('H5_HAVE_WINSOCK2_H', cc.has_header('winsock2.h'))
152152
endif
153153

@@ -259,7 +259,7 @@ endif
259259

260260
defs = []
261261
#if not windows or mingw
262-
if build_machine.system()!='darwin'
262+
if target_machine.system()!='darwin'
263263
defs += [
264264
'-D_FILE_OFFSET_BITS=64',
265265
'-D_LARGEFILE64_SOURCE',
@@ -310,7 +310,7 @@ hdf5_conf_data.set('H5_SIZEOF_INT', cc.sizeof('int'))
310310
hdf5_conf_data.set('H5_SIZEOF_UNSIGNED', cc.sizeof('unsigned'))
311311

312312

313-
if build_machine.system() != 'darwin'
313+
if target_machine.system() != 'darwin'
314314
hdf5_conf_data.set('H5_SIZEOF_LONG', cc.sizeof('long'))
315315
endif
316316

@@ -352,7 +352,7 @@ hdf5_conf_data.set('H5_SIZEOF_INT_LEAST64_T', cc.sizeof ('int_least64_t', pre
352352
hdf5_conf_data.set('H5_SIZEOF_UINT_LEAST64_T', cc.sizeof ('uint_least64_t', prefix:'#include <stdint.h>'))
353353
hdf5_conf_data.set('H5_SIZEOF_INT_FAST64_T', cc.sizeof ('int_fast64_t', prefix:'#include <stdint.h>'))
354354
hdf5_conf_data.set('H5_SIZEOF_UINT_FAST64_T', cc.sizeof ('uint_fast64_t', prefix:'#include <stdint.h>'))
355-
if build_machine.system() != 'darwin'
355+
if target_machine.system() != 'darwin'
356356
hdf5_conf_data.set('H5_SIZEOF_SIZE_T', cc.sizeof('size_t'))
357357
hdf5_conf_data.set('H5_SIZEOF_SSIZE_T', cc.sizeof('ssize_t'))
358358
if hdf5_conf_data.get('H5_SIZEOF_SSIZE_T') < 1
@@ -472,7 +472,7 @@ hdf5_conf_data.set('H5_GETTIMEOFDAY_GIVE_TZ', cc.compiles(code_gettimeofday_give
472472
hdf5_conf_data.set('H5_HAVE_TM_ZONE', 1)
473473
hdf5_conf_data.set('H5_HAVE_STRUCT_TM_TM_ZONE', 1)
474474

475-
if build_machine.system() != 'windows'
475+
if target_machine.system() != 'windows'
476476
hdf5_conf_data.set('H5_HAVE_TIMEZONE', 1)
477477
endif
478478

@@ -564,7 +564,7 @@ hdf5_conf_data.set('H5_HAVE_SOCKLEN_T', 1)
564564
#
565565

566566
# Check IOEO
567-
if build_machine.system() == 'windows'
567+
if target_machine.system() == 'windows'
568568
code_ioeo='''
569569
#include <windows.h>
570570
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
@@ -1145,7 +1145,7 @@ H5_GENERATED_HEADERS = [
11451145

11461146

11471147
# Generate 'H5detect to generate H5Tinit.c
1148-
if false
1148+
if cc_can_run
11491149
H5detect = executable('H5detect', 'H5detect.c',
11501150
c_args: hdf5_default_warnings + defs,
11511151
dependencies: ext_deps)

0 commit comments

Comments
 (0)