|
From: | Max Nikulin |
Subject: | Re: Have export treat file: paths in INCLUDED file relative to the INCLUDING file's dir |
Date: | Thu, 2 Mar 2023 19:14:02 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 01/03/2023 04:42, gnuric wrote:
h-0.h:#include "include-1/h-1.h" h-0.h: h-0.h:extern int h0; include-1/h-1.h: include-1/h-1.h:#include "include-2/h-2.h"
...
You have two #include directives in your example, which are processed recursively according to the preprocessor rules. What I had in mind was one #include preprocessor directive (similar to one #+INCLUDE: 'directive' in Org) and a non-preprocessor directive (`file:' in Org).
My idea was that second include should simulate a link relative to the include-1/h-1.h file. I have no idea which feature of cpp may be used to distinguish behavior of include and link in respect to relative paths.
My expectation is that relative paths are resolved in respect to the file where they reside. I admit that in some cases included file may be a kind of template, so it may add e.g. a logo specific to each project. However, perhaps, I would prefer to define a macro.
Notice that CPP has another feature: include path, so while searching for a file directories from a list tried till file is found:
#include <file.h> and cpp -I /usr/include/lib1 -I /usr/include/lib2 Org does not have such concept.
[Prev in Thread] | Current Thread | [Next in Thread] |