aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorGravatar Adam Cozzette <acozzette@google.com>2016-12-19 11:45:13 -0800
committerGravatar Adam Cozzette <acozzette@google.com>2016-12-19 14:38:21 -0800
commit1b3a0c16e6ac133e59d818f7b4556caf3c11b165 (patch)
tree0ce3f9cfea22d547b17e9b8843b754b580e10ff8 /src/Makefile.am
parentf39cf88a347767d25572f7344eab44359d872925 (diff)
Auto-generate well_known_types_embed.cc
Until now this file was just checked into the repo, but actually it should be generated from any.js, struct.js, and timestamp.js. This change updates the build system to make this happen. To make it work I also had to remove some C++11 features from embed.cc.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index d6f27fa8..254d428f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -483,10 +483,20 @@ libprotoc_la_SOURCES = \
google/protobuf/compiler/csharp/csharp_wrapper_field.cc \
google/protobuf/compiler/csharp/csharp_wrapper_field.h
-bin_PROGRAMS = protoc
+bin_PROGRAMS = protoc js_embed
protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
protoc_SOURCES = google/protobuf/compiler/main.cc
+# The special JS code for the well-known types is linked into the compiler via
+# well_known_types_embed.cc, which is generated from .js source files.
+js_embed_SOURCES = google/protobuf/compiler/js/embed.cc
+js_well_known_types_sources = \
+ google/protobuf/compiler/js/well_known_types/any.js \
+ google/protobuf/compiler/js/well_known_types/struct.js \
+ google/protobuf/compiler/js/well_known_types/timestamp.js
+google/protobuf/compiler/js/well_known_types_embed.cc: js_embed$(EXEEXT) $(js_well_known_types_sources)
+ ./js_embed$(EXEEXT) $(js_well_known_types_sources) > $@
+
# Tests ==============================================================
protoc_inputs = \
@@ -661,7 +671,7 @@ protoc_outputs = \
google/protobuf/util/message_differencer_unittest.pb.cc \
google/protobuf/util/message_differencer_unittest.pb.h
-BUILT_SOURCES = $(protoc_outputs)
+BUILT_SOURCES = $(protoc_outputs) google/protobuf/compiler/js/well_known_types_embed.cc
if USE_EXTERNAL_PROTOC