我正在开发一些用于在 Ada 中对 Arduino 进行编码的库。每个库都是它自己的项目,我有一个聚合库的聚合项目。我需要为每个项目指定运行时,因为它们在不同的芯片上运行。所以例如我有这样的事情:
aggregate project Agg is
for Project_Files use ("due/arduino_due.gpr",
"uno/arduino_uno.gpr",
"nano/arduino_nano.gpr");
-- ...
end Agg;
library project Arduino_Due is
-- Library_Dir, _Name, and _Kind attributes ...
-- Target attribute ...
for Runtime ("Ada") use "../runtimes/arduino_due_runtime";
package Compiler is
-- Driver and Switches attributes ...
end Compiler;
以及 Uno 和 Nano 的类似项目。直接构建arduino_due.gpr
工作正常。它应该在指定的文件夹中找到我的运行时。但是,当我构建时agg.gpr
,我得到
fatal error, run-time library not installed correctly
cannot locate file system.ads
无论我使用绝对路径还是相对路径都会发生这种情况,并且当相对路径与Project'Project_Dir
. Runtime
但是,如果我使用编译器开关而不是使用属性--RTS=...
,那么它可以工作,但前提是我使用以 . 为前缀的相对路径Project'Project_Dir
。绝对路径或普通相对路径将导致错误gprbuild: invalid runtime directory runtimes/arduino_due_runtime
。
那么这里发生了什么?这种行为似乎不一致,我在文档中找不到任何关于它的内容,所以我怀疑是一个错误。但我想我会先在这里问,以防我做错了什么。也许我应该只使用子项目或项目扩展?