How to change the default location for the compiled objects in a C project?

I would like to know how do I change the default location of the compiler created object files? As of now, it puts them in build/objs/path/of/project but how do I change it? Also, how do I then convey to the linker that the default location has changed? I am trying Gradle for a C project using GCC (sparc-rtems variant). And my source directory structure is not similar to the default Gradle structure.

Hi Ganesh,

Great question. Unfortunately, this can only be changed through internal API and it’s not trivial. Since those files are transitive files, I would suggest working with the default location. If you are looking at sharing those files, you can look into creating a static library and sharing that.

If you feel strongly about specifying a custom location for the object files, feel free to open an issue on Github with a concrete scenario and we will look into prioritizing the work.

I hope this answer your question,