[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Project out of sources compilation
From: |
Eli Zaretskii |
Subject: |
Re: Project out of sources compilation |
Date: |
Sun, 17 Mar 2024 10:45:29 +0200 |
> Date: Sun, 17 Mar 2024 08:22:56 +0100
> From: Ergus <spacibba@aol.com>
>
> >> 1. Out of sources compilation.
> >>
> >> Most of projects now prefer to do out-of sources compilation. Either to
> >> keep source code clean or to keep multiple compilations at the same time
> >> (i.e Debug/Release/win32)
> >>
> >> The project.el package has already some compilation commands, but they
> >> assume that the compilation will be executed in the project's
> >> root... which is not true most of the time.
> >>
> >> Maybe we may add an extra custom variable that could be specified in the
> >> dir-locals.el in order specify where the compilation command must be
> >> executed.
> >>
> >> Some more heuristics here is possible, but I would settle for at least
> >> something simpler.
> >
> >project.el has just one, very simple command, where the only thing that it
> >does it switch to the root first. How will you customize it? With a hook,
> >where the user would write a function "determine a directory for
> >compilation"? They might as well define a new command - or redefine this
> >one. Or just an option with relative directory name?
> >
>
> IMO the only thing we need is probably a variable/custom like
> project-build-dir. The user can define it in the dir-locals and the project
> command will use it if defined/ else use project-root. Maybe the backend
> could initialize it.
>
> Alternatively (and not totally exclusive) project.el could define a
> project-build-dir function that project backends could optionally redefine
> (i.e I use a plist as project id in gags-mode and getting any stored property
> from there is very easy with a command). By default it will be an alias for
> project-root in the VC backend.
Maybe I'm missing something, but isn't the build tree just one more
tree that is part of the project? If so, can't you use
project-external-roots to add this tree to the project? I thought
this was the mechanism to add trees to a project as included in the
original design of project.el and its support in Emacs?
> There is also some need for a 'bin' dir, that is, where the final executable
> will reside, useful to execute and debug with tools like gud and independent
> from 'build'... For example in a python project this may be the project root
> OR where the file with __main__ resides, but a python project usually won't
> specify a build dir. But let's go for one thing at a time.
Likewise here.
Or what am I missing?
Re: Project out of sources compilation, Augusto Stoffel, 2024/03/17