C5T / Current

C++ framework for realtime machine learning.
https://medium.com/dima-korolev/current-for-realtime-machine-learning-4f04aa8ab81a
97 stars 29 forks source link

Added `-I` for `current/` if it's present in `.`, `..`, or `../..`. #951

Closed dimacurrentai closed 9 months ago

dimacurrentai commented 9 months ago

Hi @mzhurovich,

In my CMakeLists.txt experiments, as well as with my dotfiles, I am now used to "just" writing:

#include "bricks/strings/split.h"

This works right away, even though, obviously, the code I work on is not in the "root" directory of the current repo. By works I mean:

Please see the footnotes for the illustration.

Now, for "toy" projects, I often just ln -sf ../current/scripts/MakefileImpl Makefile. This makes it easy to use :mak, as well as :mak test from Vim, in no time.

However, this very :mak does not work now with Current's default Makefile, since no -I dirs are set.

The proposal is to add a bit of logic into Current's default Makefile, so that if current is to be found in . or in .. or in ../.., this path is automatically added as -I when invoking g++ / clang++.

What do you think?

If you like the idea but dislike making this the behavior default, I'm also open to guarding it by some environmental flag, which I'll set in my .bashrc / .zshrc.

Thanks! Dima

Footnotes:

image

image

mzhurovich commented 9 months ago

I have mixed feelings about it tbh, this change feels like it goes in the opposite direction of the maximum cleanness we've been always striving for... But if it helps with usability out of the box, well, why not :)