From b45481a1f2b0066f57020dc4159c646aabeef448 Mon Sep 17 00:00:00 2001 From: Kevin Meagher <11620178+kjmeagher@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:14:51 -0500 Subject: [PATCH] fix msvc --- subprojects/packagefiles/cfitsio/meson.build | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/subprojects/packagefiles/cfitsio/meson.build b/subprojects/packagefiles/cfitsio/meson.build index 6896db1ca..75718d39f 100644 --- a/subprojects/packagefiles/cfitsio/meson.build +++ b/subprojects/packagefiles/cfitsio/meson.build @@ -12,13 +12,19 @@ SOVERSION = 10 cc = meson.get_compiler('c') libm = cc.find_library('m', required: false) zlib = dependency('zlib', method: 'pkg-config', required:true, fallback: ['zlib', 'zlib_dep']) -lib_deps = [libm,zlib] +lib_deps = [libm, zlib] has_fortran = false -if cc.has_header_symbol('unistd.h', 'ftruncate') - add_project_arguments('-DHAVE_UNISTD_H', '-DHAVE_FTRUNCATE', language: 'c') +if cc.has_header('unistd.h') + add_project_arguments('-DHAVE_UNISTD_H',language: 'c') + # if cc.has_header_symbol('unistd.h', 'ftruncate') + # add_project_arguments('-DHAVE_FTRUNCATE', language: 'c') + # endif +else + add_project_arguments('-DYY_NO_UNISTD_H', language: 'c') endif + # # if cc.get_id() != 'msvc' # if host_machine.system() != 'windows'