- Edited
There actually is such a feature already, which was maybe used once. If you include a run.sh
file in your project, then make
(and pressing run in the IDE) will simply run that (see here). This does not even need to do
a) it generates an executable, same name as project
the run.sh
file will be in charge of doing whatever needed to run the project. What this means is entirely up to you. Notice that if from within run.sh
you want to call Bela's own Makefile
, you'd need to define some constants (e.g.: make PROJECT=yourProject HAS_RUN_FILE=false SHOULD_BUILD=true PROJECT_TYPE=cpp
) when calling it or you'll end up recursively calling run.sh
.
Notice that this at the moment discards all the command-line settings from the IDE, but I guess those could be brought back in editing the line
RUN_COMMAND?=bash $(RUN_FILE)
to, e.g.:
RUN_COMMAND?=bash $(RUN_FILE) CL="$(CL)"
thetechnobear (compiling ableton link header in my render.cpp, is taking about 5 mins each time... so has been very time consuming... to the point I even consider putting it into a shared lib.. but unfortunately that doesnt help, if I need to change that lib code at all)
For using it within your project could you not write a wrapper library (or just a class really) whose header does not directly include the long-to-compile headers? Something like:
fastlink.h:
#pragma once
class AbletonLink; // instead of including a header file, just say the class exists, don't give any indication as to what is in it
class FastAbletonLink
{
... expose here the methods you actually need ...
AbletonLink* obj; // <<-- as long as this is a pointer, there is no need for this file to know about the contents of the AbletonLink class
};
fastlink.cpp:
#include <AbletonLink-long-long-header.h>
... implementations of the methods, which may be mostly just calling the corresponding method from the AbletonLink class ...
If there are not many methods this could be a good option (unless I am misunderstanding the issue).
Another option to simplify your workflow, as you often use cmake
could be to have the Bela code code built as a library (make lib
makes lib/libbela.so
and lib/libbelaextra.so
) and then add that (or those) libraries as dependencies to your cmake
project. This is what we do for Supercollider and Csound.