AlexeyDmitriev / JHelper

GNU Lesser General Public License v3.0
119 stars 31 forks source link

Is it possible to treat some library files as "standard library" and not inline them? #130

Closed GoBigorGoHome closed 3 years ago

GoBigorGoHome commented 3 years ago

Some OJs, e.g. AtCoder, provides libraries, is it possible for JHelper not to inline them, but treat them as if they were "standard library"?

AlexeyDmitriev commented 3 years ago

Here is the check to determine whether to inline specific file (and its implementation on line 48), so my understanding is that if you just place the files of this library outside of the project, it should ignore the file (the same way it works with standard library).

Please let me know whether it works

AlexeyDmitriev commented 3 years ago

Hi, @GoBigorGoHome can you confirm whether it worked for you?

GoBigorGoHome commented 3 years ago

@AlexeyDmitriev Sorry for delay. Your understanding is mostly right. In fact, as the function name isInProjectSources indicates, only those include files that are in project sources are inlined. As far as I know, only those files that are listed as source files of some target in CMakeLists.txt or those files in directories marked as "Project Sources and Headers" are considered "InProjectSources".

So, if a library should be inlined, then put it inside the project directory and mark it as "Project Sources and Headers". If the library should not be inlined, just do not mark, it does not matter whether the library is inside the project or not.

marked as Project sources