diff options
author | David G. Quintas <dgq@google.com> | 2018-06-14 17:32:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-14 17:32:26 -0700 |
commit | 1c6d6ba851b6d65ce8757b468b21b0235f9b5312 (patch) | |
tree | e80ced672e2bae9a8c24fb1a591e6d8d0f42f5e8 /templates | |
parent | 5bc31dbd42f2ed4f1aa1bba9548b1b87f286792c (diff) | |
parent | 39fbed3589aa0e240acfcbe4b04971c0f9472a21 (diff) | |
download | grpc-grpc-1c6d6ba851b6d65ce8757b468b21b0235f9b5312.tar.gz |
Merge pull request #15595 from dgquintas/nanopb_build_cleanup
Treat nanopb as a regular external dep
Diffstat (limited to 'templates')
-rw-r--r-- | templates/CMakeLists.txt.template | 3 | ||||
-rw-r--r-- | templates/Makefile.template | 2 | ||||
-rw-r--r-- | templates/gRPC-C++.podspec.template | 8 | ||||
-rw-r--r-- | templates/gRPC-Core.podspec.template | 3 |
4 files changed, 9 insertions, 7 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 435217bacd..a7f59e15a7 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -168,6 +168,7 @@ include(cmake/gflags.cmake) include(cmake/benchmark.cmake) include(cmake/address_sorting.cmake) + include(cmake/nanopb.cmake) if(NOT MSVC) set(CMAKE_C_FLAGS "<%text>${CMAKE_C_FLAGS}</%text> -std=c99") @@ -383,6 +384,7 @@ PRIVATE <%text>${_gRPC_CARES_INCLUDE_DIR}</%text> PRIVATE <%text>${_gRPC_GFLAGS_INCLUDE_DIR}</%text> PRIVATE <%text>${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}</%text> + PRIVATE <%text>${_gRPC_NANOPB_INCLUDE_DIR}</%text> % if lib.build in ['test', 'private'] and lib.language == 'c++': PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest @@ -464,6 +466,7 @@ PRIVATE <%text>${_gRPC_CARES_INCLUDE_DIR}</%text> PRIVATE <%text>${_gRPC_GFLAGS_INCLUDE_DIR}</%text> PRIVATE <%text>${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}</%text> + PRIVATE <%text>${_gRPC_NANOPB_INCLUDE_DIR}</%text> % if tgt.build in ['test', 'private'] and tgt.language == 'c++': PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest diff --git a/templates/Makefile.template b/templates/Makefile.template index 43fa904768..4a04af122d 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -221,8 +221,6 @@ % endif % endfor - DEFINES += PB_FIELD_16BIT - CPPFLAGS += $(CPPFLAGS_$(CONFIG)) CFLAGS += $(CFLAGS_$(CONFIG)) CXXFLAGS += $(CXXFLAGS_$(CONFIG)) diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template index 12d5fc17d4..2853bb63ab 100644 --- a/templates/gRPC-C++.podspec.template +++ b/templates/gRPC-C++.podspec.template @@ -196,9 +196,9 @@ end s.prepare_command = <<-END_OF_COMMAND - find src/cpp/ -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\; - find src/cpp/ -name "*.back" -type f -delete - find src/core/ -regex ".*\.h" -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\; - find src/core/ -name "*.back" -type f -delete + find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g' + find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm + find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g' + find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm END_OF_COMMAND end diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index a767a612a6..5098f351db 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -220,6 +220,7 @@ # 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 ! -path '*.back*' -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\; + find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g' + find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm END_OF_COMMAND end |