-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add --local-flint to set rpath in dev build
- Loading branch information
1 parent
57b7386
commit 5d52824
Showing
6 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build/* | ||
build-install/* | ||
dist/* | ||
src/flint/**/*.c | ||
src/flint/*.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import os.path | ||
import click | ||
from spin.cmds import meson | ||
|
||
# | ||
# Wrap spin's build command to add the --local-flint argument | ||
# | ||
|
||
@click.command() | ||
@click.argument("meson_args", nargs=-1) | ||
@click.option("-j", "--jobs", help="Number of parallel tasks to launch", type=int) | ||
@click.option("--clean", is_flag=True, help="Clean build directory before build") | ||
@click.option( | ||
"-v", "--verbose", is_flag=True, help="Print all build output, even installation" | ||
) | ||
|
||
@click.option("--local-flint", | ||
help="Path to pkgconfig directory for a local build of flint and other directories") | ||
|
||
@click.pass_context | ||
def build(ctx, *args, local_flint=None, **kwargs): | ||
"""🔧 Build package with Meson/ninja and install | ||
To link against a local build of flint use e.g. | ||
spin build --local-flint=.local/lib/pkgconfig | ||
MESON_ARGS are passed through e.g.: | ||
spin build -- -Dpkg_config_path=/lib64/pkgconfig | ||
The package is installed to build-install | ||
By default meson-python does release builds. To be able to use a debugger, | ||
tell meson to build in debug mode: | ||
spin build -- -Dbuildtype=debug | ||
or set CFLAGS appropriately: | ||
CFLAGS="-O0 -g" spin build | ||
""" | ||
if local_flint is not None: | ||
pkg_config_path = os.path.abspath(local_flint) | ||
ctx.params["meson_args"] += ( | ||
f'-Dpkg_config_path={pkg_config_path}', | ||
f'-Dadd_flint_rpath=true', | ||
) | ||
|
||
del ctx.params["local_flint"] | ||
|
||
# Call spin's build function | ||
ctx.forward(meson.build) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
option('add_flint_rpath', type : 'boolean', value : false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cython | ||
spin | ||
meson | ||
meson-python | ||
pytest | ||
coverage | ||
pytest-cov |