Przeglądaj źródła

Merge pull request #11712 from muxi/fix-nanopb-include

Fix the nanopb's header include issue
Muxi Yan 8 lat temu
rodzic
commit
c9227a3d03
2 zmienionych plików z 10 dodań i 0 usunięć
  1. 5 0
      gRPC-Core.podspec
  2. 5 0
      templates/gRPC-Core.podspec.template

+ 5 - 0
gRPC-Core.podspec

@@ -988,4 +988,9 @@ Pod::Spec.new do |s|
                       'test/core/util/port.c',
                       'test/core/util/port_server_client.{c,h}'
   end
+
+  # TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
+  s.prepare_command = <<-END_OF_COMMAND
+    find src/core/ -type f -exec sed -E -i '.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\;
+  END_OF_COMMAND
 end

+ 5 - 0
templates/gRPC-Core.podspec.template

@@ -193,4 +193,9 @@
                         'test/core/util/port.c',
                         'test/core/util/port_server_client.{c,h}'
     end
+
+    # TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
+    s.prepare_command = <<-END_OF_COMMAND
+      find src/core/ -type f -exec sed -E -i '.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\;
+    END_OF_COMMAND
   end