fix-default-proto-file-path.patch 826 B

1234567891011121314151617181920
  1. diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
  2. index f192ae6..22900ed 100644
  3. --- a/src/google/protobuf/compiler/command_line_interface.cc
  4. +++ b/src/google/protobuf/compiler/command_line_interface.cc
  5. @@ -260,11 +260,15 @@ void AddDefaultProtoPaths(
  6. return;
  7. }
  8. // Check if the upper level directory has an "include" subdirectory.
  9. + // change "'$/bin' is next to 'include'" assumption to "'$/bin/tools' is next to 'include'"
  10. + for (int i = 0; i < 2; i++)
  11. + {
  12. pos = path.find_last_of("/\\");
  13. if (pos == std::string::npos || pos == 0) {
  14. return;
  15. }
  16. path = path.substr(0, pos);
  17. + }
  18. if (IsInstalledProtoPath(path + "/include")) {
  19. paths->push_back(
  20. std::pair<std::string, std::string>("", path + "/include"));