Allow custom build directory#221
Conversation
|
@lagru Ready for testing. |
63c35e5 to
d8eac75
Compare
| This feature is useful in combination with a shell alias, e.g.: | ||
|
|
||
| $ alias spin-clang="spin -C build-clang" | ||
|
|
||
| Which can then be used to build (`spin-clang build`), to test (`spin-clang test ...`), etc. |
There was a problem hiding this comment.
The name build-clang might be a bit misleading. To me it implies that this feature can somehow be used to choose a different compiler (clang). As I understand it, you'd need to update the underlying "build" command / configuration which would then apply regardless of build directory? Or am I missing something?
spin/cmds/meson.py
Outdated
|
|
||
| This feature is useful in combination with a shell alias, e.g.: | ||
|
|
||
| $ alias spin-clang="spin -C build-clang" |
There was a problem hiding this comment.
spin -C ${SOME_DIR} command seems to fail. I think this is because the option is added ad subcommand level. So this alias won't work currently. I think the option would need to be added to the top-level spin command and then passed down via the context.
There was a problem hiding this comment.
Right, may have to rethink that. We don't have global context in spin.
|
@lagru Please take another look; the build directory can now be absolute, and can be set using |
lagru
left a comment
There was a problem hiding this comment.
Thanks. Absolute, relative and nested-relative paths seem to work perfectly now. I'm not familiar with the code base so take my approval with a grain of salt. ;)
|
Nice! I was just about to suggest this feature. I just gave it a quick er... spin and it seems to work exactly as I wanted. One suggestion though: When you run meson setup build-release -Dbuildtype=release
spin -C build-release run ...Then the |
|
@oscarbenjamin What you request sounds very reasonable, but it's already the way my setup behaves: $ spin build -C build-xyz && ls -al build-xyz/.gitignore
-rw-r--r--. 1 stefan stefan 92 Sep 2 21:05 build-xyz/.gitignoreI see the same behavior when adding the |
I've just checked again and confirm that the $ spin build -C build-foo -- --pkg-config-path=.local/lib/pkgconfig -Dadd_flint_rpath=true
...
$ git status
On branch pr_nmod_ctx
Your branch is up-to-date with 'origin/pr_nmod_ctx'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
build-abc-install/
build-foo-install/
build-xyz-install/
nothing added to commit but untracked files present (use "git add" to track)Is it meson that adds it in the I didn't expect that |
Closes #171
-Cflag to meson commands