diff options
author | Adam Cozzette <acozzette@google.com> | 2016-12-19 11:45:13 -0800 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2016-12-19 14:38:21 -0800 |
commit | 1b3a0c16e6ac133e59d818f7b4556caf3c11b165 (patch) | |
tree | 0ce3f9cfea22d547b17e9b8843b754b580e10ff8 /cmake | |
parent | f39cf88a347767d25572f7344eab44359d872925 (diff) | |
download | protobuf-1b3a0c16e6ac133e59d818f7b4556caf3c11b165.tar.gz protobuf-1b3a0c16e6ac133e59d818f7b4556caf3c11b165.tar.bz2 protobuf-1b3a0c16e6ac133e59d818f7b4556caf3c11b165.zip |
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 'cmake')
-rw-r--r-- | cmake/libprotoc.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake index 2d238449..215abcd8 100644 --- a/cmake/libprotoc.cmake +++ b/cmake/libprotoc.cmake @@ -94,6 +94,18 @@ set(libprotoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.cc ) +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 +) + add_library(libprotoc ${protobuf_SHARED_OR_STATIC} ${libprotoc_files}) target_link_libraries(libprotoc libprotobuf) |