From c0326f6fcaceffe8ab3d071b9cbf47849cc91814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 15 May 2023 12:12:10 +0200 Subject: Fix gpb proto compilation with imports The option {i, ...} is added for every directory containing proto files. The option {use_packages, true} was added as well to allow using packages. This is not the default for historic reasons in gpb but it makes better sense to have it as default so we do it. --- CHANGELOG.asciidoc | 3 +++ plugins/protobuffs.mk | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 3a8540b..c227dde 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -40,3 +40,6 @@ 2023/05/12: A number of broken packages have been removed. They were all unmaintained and there's a low chance that this will break anyone's project. + +2023/05/15: Protobuff compilation with `gpb` now uses the + `{use_packages, true}` option. diff --git a/plugins/protobuffs.mk b/plugins/protobuffs.mk index 809df42..0ebe159 100644 --- a/plugins/protobuffs.mk +++ b/plugins/protobuffs.mk @@ -41,10 +41,13 @@ else define compile_proto.erl [begin gpb_compile:file(F, [ + $(foreach i,$(sort $(dir $(PROTO_FILES))),{i$(comma) "$i"}$(comma)) {include_as_lib, true}, {module_name_suffix, "_pb"}, {o_hrl, "./include"}, - {o_erl, "./src"}]) + {o_erl, "./src"}, + {use_packages, true} + ]) end || F <- string:tokens("$1", " ")], halt(). endef -- cgit v1.2.3