Gradle C plugin: how to solve references between multiple modules -
i have c language program has following structure:
src/main/c/main.c src/main/headers/main.h src/module_1/c/module_1.h src/module_1/headers/module_1.h ... src/modulen/c/module_n.c src/module/headers/module_n.h in gradle script have defined:
components { module_1(nativelibraryspec) ... module_n(nativelibraryspec) main(nativeexecutablespec){ sources{ c.lib library: "module_1", linkage: "static" ... c.lib library: "module_n", linkage: "static" } the reason of using structure facilitate creating unit tests each module separately.
the problem comes inclusion of .h files modules in main or in other modules (there dependencies between them). haven't found way make headers of module available other modules. make them "global" project (that is, automatically added source set module).
thanks in advance
i not know gradle may give general advise.
i haven't found way make headers of module available other modules.
you make central directory (repository) .h files of project, example src/include. header files of each module can placed there (in version of curent baseline).
i make them "global" project (that is, automatically added source set module).
the above repository can support that. however, including header in source file manual task. wise not include headers source file; may need few.
Comments
Post a Comment