Property to get the temporary build folder name

Hi,

I have a library that has dependencies on functions defined in a sketch that uses that library. From the library:

foo.c:

void foo()
{
   a_function();
}

The a_function() is defined inside the sketch:

my_sketch.ino:

void a_function()
{
   ...
}

However, the linker cannot find the symbol a_function() because it’s inside the temporary folder, so my question is: What is the property (those used in the platform.txt file) that I can use to get the location of the temporary folder?

By property I mean, for example:

runtime.tools.avr-gcc.path
compiler.warning_flags
build.source.path
Etc.

I didn’t find anything related to my problem here: Platform specification - Arduino CLI

Thank you!

The property is build.path
https://arduino.github.io/arduino-cli/latest/platform-specification/#build-process
The preprocessed sketch code is under the sketch subfolder.

But there is a much better way to accomplish this than modifying platform.txt. You can pass a pointer to the function from the sketch to the library via a function argument (e.g., a “callback”).

1 Like

Thank you for your prompt reply!

Unfortunately I cannot modify neither the library nor the foo() function signature. I’ll try with the advece you gave me: build.path

Greetings!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.