Browse Source

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.
Loïc Hoguin 1 year ago
parent
commit
c0326f6fca
2 changed files with 7 additions and 1 deletions
  1. 3 0
      CHANGELOG.asciidoc
  2. 4 1
      plugins/protobuffs.mk

+ 3 - 0
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.

+ 4 - 1
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