Skip to content

Commit 7320ba2

Browse files
committed
mimicking Scipy:6 (attempt to use *.lib)
1 parent 272777f commit 7320ba2

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

meson.build

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,31 @@ if pyprojectwheelbuild_enabled
6868
'src/example_fgen_basic/runtime_helpers.py',
6969
)
7070

71-
# The ancillary library,
72-
# i.e. all the stuff for wrapping that isn't directly exposed to Python.
73-
ancillary_lib = library(
74-
'@0@-ancillary'.format(meson.project_name()),
75-
sources: srcs_ancillary_lib,
76-
version: meson.project_version(),
77-
dependencies: [],
78-
# any other dependencies which aren't in source e.g. fgen-core
79-
# e.g. dependencies: [fgen_core_dep],
80-
install: false,
81-
)
71+
if host_machine.system() == 'windows'
72+
meson.override_find_program('ar', find_program('llvm-lib', required: true))
73+
# also tell Meson to use MSVC-compatible static library
74+
ancillary_lib = library(
75+
'@0@-ancillary'.format(meson.project_name()),
76+
sources: srcs_ancillary_lib,
77+
version: meson.project_version(),
78+
dependencies: [],
79+
static: true,
80+
install: false,
81+
override_options: ['b_vscrt=md', 'default_library=static', 'vs_library_format=lib']
82+
)
83+
else
84+
# The ancillary library,
85+
# i.e. all the stuff for wrapping that isn't directly exposed to Python.
86+
ancillary_lib = library(
87+
'@0@-ancillary'.format(meson.project_name()),
88+
sources: srcs_ancillary_lib,
89+
version: meson.project_version(),
90+
dependencies: [],
91+
# any other dependencies which aren't in source e.g. fgen-core
92+
# e.g. dependencies: [fgen_core_dep],
93+
install: false,
94+
)
95+
endif
8296

8397
ancillary_dep = declare_dependency(link_with: ancillary_lib)
8498

0 commit comments

Comments
 (0)