Skip to content

Commit

Permalink
Remove js_embed binary. (protocolbuffers#4709)
Browse files Browse the repository at this point in the history
* Remove js_embed binary.
  • Loading branch information
xfxyjwf committed Jul 17, 2018
1 parent 0b3b470 commit b3e4e3a
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 159 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -47,7 +47,6 @@ any_test.pb.*
map*unittest.pb.*
unittest*.pb.*
cpp_test*.pb.*
src/google/protobuf/compiler/js/well_known_types_embed.cc
src/google/protobuf/util/**/*.pb.cc
src/google/protobuf/util/**/*.pb.h

Expand Down
18 changes: 0 additions & 18 deletions BUILD
Expand Up @@ -257,24 +257,6 @@ internal_copied_filegroup(
# Protocol Buffers Compiler
################################################################################

cc_binary(
name = "js_embed",
srcs = ["src/google/protobuf/compiler/js/embed.cc"],
visibility = ["//visibility:public"],
)

genrule(
name = "generate_js_well_known_types_embed",
srcs = [
"src/google/protobuf/compiler/js/well_known_types/any.js",
"src/google/protobuf/compiler/js/well_known_types/struct.js",
"src/google/protobuf/compiler/js/well_known_types/timestamp.js",
],
outs = ["src/google/protobuf/compiler/js/well_known_types_embed.cc"],
cmd = "$(location :js_embed) $(SRCS) > $@",
tools = [":js_embed"],
)

cc_library(
name = "protoc_lib",
srcs = [
Expand Down
14 changes: 4 additions & 10 deletions cmake/libprotoc.cmake
Expand Up @@ -161,17 +161,11 @@ set(libprotoc_headers
${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.h
)

set(js_well_known_types_sources
${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/any.js
${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/struct.js
${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/timestamp.js
)
add_executable(js_embed ${protobuf_source_dir}/src/google/protobuf/compiler/js/embed.cc)
add_custom_command(
OUTPUT ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
DEPENDS js_embed ${js_well_known_types_sources}
COMMAND js_embed ${js_well_known_types_sources} > ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
if (MSVC)
set(libprotoc_rc_files
${CMAKE_CURRENT_BINARY_DIR}/version.rc
)
endif()

add_library(libprotoc ${protobuf_SHARED_OR_STATIC}
${libprotoc_files} ${libprotoc_headers})
Expand Down
21 changes: 1 addition & 20 deletions src/Makefile.am
Expand Up @@ -56,9 +56,7 @@ clean-local:

CLEANFILES = $(protoc_outputs) unittest_proto_middleman \
testzip.jar testzip.list testzip.proto testzip.zip \
no_warning_test.cc \
google/protobuf/compiler/js/well_known_types_embed.cc \
js_embed$(EXEEXT)
no_warning_test.cc

MAINTAINERCLEANFILES = \
Makefile.in
Expand Down Expand Up @@ -471,22 +469,6 @@ bin_PROGRAMS = protoc
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. We have
# to build the js_embed binary using $(CXX_FOR_BUILD) so that it is executable
# on the build machine in a cross-compilation setup.
js_embed$(EXEEXT): $(srcdir)/google/protobuf/compiler/js/embed.cc
$(CXX_FOR_BUILD) -o $@ $<
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
# We have to cd to $(srcdir) so that out-of-tree builds work properly.
google/protobuf/compiler/js/well_known_types_embed.cc: js_embed$(EXEEXT) $(js_well_known_types_sources)
mkdir -p `dirname $@` && \
oldpwd=`pwd` && cd $(srcdir) && \
$$oldpwd/js_embed$(EXEEXT) $(js_well_known_types_sources) > $$oldpwd/$@

# Tests ==============================================================

protoc_inputs = \
Expand Down Expand Up @@ -565,7 +547,6 @@ EXTRA_DIST = \
google/protobuf/package_info.h \
google/protobuf/io/package_info.h \
google/protobuf/util/package_info.h \
google/protobuf/compiler/js/embed.cc \
google/protobuf/compiler/ruby/ruby_generated_code.proto \
google/protobuf/compiler/ruby/ruby_generated_code_pb.rb \
google/protobuf/compiler/package_info.h \
Expand Down
110 changes: 0 additions & 110 deletions src/google/protobuf/compiler/js/embed.cc

This file was deleted.

0 comments on commit b3e4e3a

Please sign in to comment.