Skip to content

Commit 2940367

Browse files
committed
fix for cross compiling on darwin
1 parent 76e4e7a commit 2940367

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

externals/cgns/hdf5/meson.build

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ else
8181
hdf5_conf_data.set('H5_DEFAULT_PLUGINDIR', '/usr/local/hdf5/lib/plugin')
8282
endif
8383

84+
if build_machine.system()=='darwin'
85+
hdf5_conf_data.set('H5_HAVE_DARWIN', 1)
86+
endif
87+
8488
#if cc.has_function('difftime', prefix : '#include <time.h>')
8589
# # function exists, do whatever is required.
8690
#endif
@@ -253,15 +257,16 @@ else
253257
hdf5_conf_data.set('H5_HAVE_LIBUCB', 1)
254258
endif
255259

256-
257-
defs = [
258-
'-D_FILE_OFFSET_BITS=64',
259-
'-D_LARGEFILE64_SOURCE',
260-
'-D_LARGEFILE_SOURCE',
261-
]
262-
260+
defs = []
263261
#if not windows or mingw
264-
defs += ['-D_POSIX_C_SOURCE=200809L', '-D_GNU_SOURCE',]
262+
if build_machine.system()!='darwin'
263+
defs += [
264+
'-D_FILE_OFFSET_BITS=64',
265+
'-D_LARGEFILE64_SOURCE',
266+
'-D_LARGEFILE_SOURCE',]
267+
268+
defs += ['-D_POSIX_C_SOURCE=200809L', '-D_GNU_SOURCE',]
269+
endif
265270
#endif
266271

267272
if not(cc.has_function('lseek64', prefix: '''#include <sys/types.h>
@@ -614,11 +619,6 @@ hdf5_conf_data.set('H5_USE_FILE_LOCKING', 1)
614619
hdf5_conf_data.set('H5_IGNORE_DISABLED_FILE_LOCKS', 1)
615620
hdf5_conf_data.set('H5_HAVE_LARGE_HSIZET', 1)
616621

617-
if build_machine.system() == 'darwin'
618-
hdf5_conf_data.set('H5_HAVE_DARWIN', 1)
619-
endif
620-
621-
622622
if mpi
623623
hdf5_conf_data.set('H5_HAVE_PARALLEL', 1)
624624
ext_deps += mpi_dep
@@ -1145,7 +1145,7 @@ H5_GENERATED_HEADERS = [
11451145

11461146

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

0 commit comments

Comments
 (0)