diff options
author | Matti Picus <matti.picus@gmail.com> | 2022-11-30 14:50:24 +0200 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2023-02-20 21:07:30 +0000 |
commit | 40eaa55f6439772e25d2d73d6edf96b149694987 (patch) | |
tree | e9f5f80972b6bdd01c6991ba0cb777cf562e7cc6 /numpy/core/meson.build | |
parent | f6eaca8c63a06b588e73d7d189604f978e6dffe6 (diff) | |
download | numpy-40eaa55f6439772e25d2d73d6edf96b149694987.tar.gz |
BUILD: fixes for MSVC
Diffstat (limited to 'numpy/core/meson.build')
-rw-r--r-- | numpy/core/meson.build | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/numpy/core/meson.build b/numpy/core/meson.build index 50db93951..e094f9dab 100644 --- a/numpy/core/meson.build +++ b/numpy/core/meson.build @@ -109,11 +109,19 @@ cdata.set('NPY_SIZEOF_PY_LONG_LONG', if cc.has_header('complex.h') cdata.set10('HAVE_COMPLEX_H', true) cdata.set10('NPY_USE_C99_COMPLEX', true) - complex_types_to_check = [ - ['NPY_HAVE_COMPLEX_FLOAT', 'NPY_SIZEOF_COMPLEX_FLOAT', 'complex float', 'float'], - ['NPY_HAVE_COMPLEX_DOUBLE', 'NPY_SIZEOF_COMPLEX_DOUBLE', 'complex double', 'double'], - ['NPY_HAVE_COMPLEX_LONG_DOUBLE', 'NPY_SIZEOF_COMPLEX_LONGDOUBLE', 'complex long double', 'long double'], - ] + if cc.get_id() == 'msvc' + complex_types_to_check = [ + ['NPY_HAVE_COMPLEX_FLOAT', 'NPY_SIZEOF_COMPLEX_FLOAT', '_Fcomplex', 'float'], + ['NPY_HAVE_COMPLEX_DOUBLE', 'NPY_SIZEOF_COMPLEX_DOUBLE', '_Dcomplex', 'double'], + ['NPY_HAVE_COMPLEX_LONG_DOUBLE', 'NPY_SIZEOF_COMPLEX_LONGDOUBLE', '_Lcomplex', 'long double'], + ] + else + complex_types_to_check = [ + ['NPY_HAVE_COMPLEX_FLOAT', 'NPY_SIZEOF_COMPLEX_FLOAT', 'complex float', 'float'], + ['NPY_HAVE_COMPLEX_DOUBLE', 'NPY_SIZEOF_COMPLEX_DOUBLE', 'complex double', 'double'], + ['NPY_HAVE_COMPLEX_LONG_DOUBLE', 'NPY_SIZEOF_COMPLEX_LONGDOUBLE', 'complex long double', 'long double'], + ] + endif foreach symbol_type: complex_types_to_check if cc.has_type(symbol_type[2], prefix: '#include <complex.h>') cdata.set10(symbol_type[0], true) @@ -250,7 +258,9 @@ else # function is not available in CI. For the latter there is a fallback path, # but that is broken because we don't have the exact long double # representation checks. - cdata.set10('HAVE_STRTOLD_L', false) + if cc.get_id() != 'msvc' + cdata.set10('HAVE_STRTOLD_L', false) + endif endif # Other optional functions @@ -451,7 +461,7 @@ if cc.get_id() == 'msvc' # libnpymath and libnpyrandom) if cc.has_argument('-d2VolatileMetadata-') staticlib_cflags += '-d2VolatileMetadata-' - endif + endif endif # TODO: change to "feature" option in meson_options.txt? See # https://mesonbuild.com/Build-options.html#build-options |