Преглед на файлове

Update experimental SEBS file to support cross-compiling.

temporal преди 16 години
родител
ревизия
ad5672bad7
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      src/google/protobuf/SEBS

+ 5 - 1
src/google/protobuf/SEBS

@@ -134,8 +134,11 @@ class ProtobufLibrary(sebs.Rule):
 
 
     protoc.expand_once()
     protoc.expand_once()
 
 
+    # We must build protoc for the host configuration to allow cross-compiling.
+    host_protoc = self.context.configured_artifact(protoc.binary, "host")
+
     protoc_action = self.context.action(self, "protobuf")
     protoc_action = self.context.action(self, "protobuf")
-    protoc_args = [protoc.binary, "-Isrc", "-Itmp", "-Iinclude","--cpp_out=tmp"]
+    protoc_args = [host_protoc, "-Isrc", "-Itmp", "-Iinclude","--cpp_out=tmp"]
 
 
     cpp_srcs = []
     cpp_srcs = []
     for src in args.srcs:
     for src in args.srcs:
@@ -166,6 +169,7 @@ class ProtobufLibrary(sebs.Rule):
 
 
     self.__cpp_library = _cpp.Library(srcs = cpp_srcs, deps = deps,
     self.__cpp_library = _cpp.Library(srcs = cpp_srcs, deps = deps,
                                       context = self.context)
                                       context = self.context)
+    self.__cpp_library.label = self.label
     self.outputs = []
     self.outputs = []
 
 
   def as_cpp_library(self):
   def as_cpp_library(self):