Skip to content

Commit

Permalink
bringing back user options
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed May 24, 2024
1 parent 8194245 commit ccbe104
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ endif
# https://mesonbuild.com/Python-module.html
# Here we differentiate from the python used by meson, py3_command, and that python target, py3_target. This is useful
# when cross compiling like on conda-forge
py3 = import('python').find_installation(pure: false)
#py3 = import('python').find_installation(pure: false)
py_mod = import('python')
if get_option('python_target') != ''
py3 = py_mod.find_installation(get_option('python_target'))
else
py3 = py_mod.find_installation('python')
endif
py3_dep = py3.dependency()

message(py3.path())
Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
option('incdir_numpy', type: 'string', value: '',
description: 'Include directory for numpy. If left empty Meson will try to find it on its own.')

option('python_target', type: 'string', value: '',
description: '''Target python path. This is used in the case that the Python installation that PyOptSparse is intended
to be built for is different than the Python installation that is used to run Meson. For example, Meson may be installed
on the user's system which is run using the system Python installation, but the user may want build PyOptSparse for
a Python installation in a virtual environment. Leave as an empty string to build for Python installation running
Meson.''')

0 comments on commit ccbe104

Please sign in to comment.