| licenses(["notice"]) |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| package_name = "cereal" |
| package_version = "1.2.2" # This version number needs to match the one in WORKSPACE file |
| |
| package_file = package_name + "-" + package_version + ".tar.gz" |
| package_dir = package_name + "-" + package_version |
| |
| file_list = [ |
| "include/cereal/access.hpp", |
| "include/cereal/archives/adapters.hpp", |
| "include/cereal/archives/binary.hpp", |
| "include/cereal/archives/json.hpp", |
| "include/cereal/archives/portable_binary.hpp", |
| "include/cereal/archives/xml.hpp", |
| "include/cereal/cereal.hpp", |
| "include/cereal/details/helpers.hpp", |
| "include/cereal/details/polymorphic_impl.hpp", |
| "include/cereal/details/polymorphic_impl_fwd.hpp", |
| "include/cereal/details/static_object.hpp", |
| "include/cereal/details/traits.hpp", |
| "include/cereal/details/util.hpp", |
| "include/cereal/external/base64.hpp", |
| "include/cereal/external/rapidjson/allocators.h", |
| "include/cereal/external/rapidjson/document.h", |
| "include/cereal/external/rapidjson/encodedstream.h", |
| "include/cereal/external/rapidjson/encodings.h", |
| "include/cereal/external/rapidjson/error/en.h", |
| "include/cereal/external/rapidjson/error/error.h", |
| "include/cereal/external/rapidjson/filereadstream.h", |
| "include/cereal/external/rapidjson/filewritestream.h", |
| "include/cereal/external/rapidjson/fwd.h", |
| "include/cereal/external/rapidjson/internal/biginteger.h", |
| "include/cereal/external/rapidjson/internal/diyfp.h", |
| "include/cereal/external/rapidjson/internal/dtoa.h", |
| "include/cereal/external/rapidjson/internal/ieee754.h", |
| "include/cereal/external/rapidjson/internal/itoa.h", |
| "include/cereal/external/rapidjson/internal/meta.h", |
| "include/cereal/external/rapidjson/internal/pow10.h", |
| "include/cereal/external/rapidjson/internal/regex.h", |
| "include/cereal/external/rapidjson/internal/stack.h", |
| "include/cereal/external/rapidjson/internal/strfunc.h", |
| "include/cereal/external/rapidjson/internal/strtod.h", |
| "include/cereal/external/rapidjson/internal/swap.h", |
| "include/cereal/external/rapidjson/istreamwrapper.h", |
| "include/cereal/external/rapidjson/memorybuffer.h", |
| "include/cereal/external/rapidjson/memorystream.h", |
| "include/cereal/external/rapidjson/msinttypes/inttypes.h", |
| "include/cereal/external/rapidjson/msinttypes/stdint.h", |
| "include/cereal/external/rapidjson/ostreamwrapper.h", |
| "include/cereal/external/rapidjson/pointer.h", |
| "include/cereal/external/rapidjson/prettywriter.h", |
| "include/cereal/external/rapidjson/rapidjson.h", |
| "include/cereal/external/rapidjson/reader.h", |
| "include/cereal/external/rapidjson/schema.h", |
| "include/cereal/external/rapidjson/stream.h", |
| "include/cereal/external/rapidjson/stringbuffer.h", |
| "include/cereal/external/rapidjson/writer.h", |
| "include/cereal/external/rapidxml/rapidxml.hpp", |
| "include/cereal/external/rapidxml/rapidxml_iterators.hpp", |
| "include/cereal/external/rapidxml/rapidxml_print.hpp", |
| "include/cereal/external/rapidxml/rapidxml_utils.hpp", |
| "include/cereal/macros.hpp", |
| "include/cereal/types/array.hpp", |
| "include/cereal/types/base_class.hpp", |
| "include/cereal/types/bitset.hpp", |
| "include/cereal/types/boost_variant.hpp", |
| "include/cereal/types/chrono.hpp", |
| "include/cereal/types/common.hpp", |
| "include/cereal/types/complex.hpp", |
| "include/cereal/types/concepts/pair_associative_container.hpp", |
| "include/cereal/types/deque.hpp", |
| "include/cereal/types/forward_list.hpp", |
| "include/cereal/types/functional.hpp", |
| "include/cereal/types/list.hpp", |
| "include/cereal/types/map.hpp", |
| "include/cereal/types/memory.hpp", |
| "include/cereal/types/polymorphic.hpp", |
| "include/cereal/types/queue.hpp", |
| "include/cereal/types/set.hpp", |
| "include/cereal/types/stack.hpp", |
| "include/cereal/types/string.hpp", |
| "include/cereal/types/tuple.hpp", |
| "include/cereal/types/unordered_map.hpp", |
| "include/cereal/types/unordered_set.hpp", |
| "include/cereal/types/utility.hpp", |
| "include/cereal/types/valarray.hpp", |
| "include/cereal/types/vector.hpp", |
| ] |
| |
| genrule( |
| name = "cereal-srcs", |
| srcs = [ |
| package_file, |
| ], |
| outs = file_list, |
| cmd = "\n".join([ |
| "export WORKSPACE_ROOT=$$(pwd)", |
| "export INSTALL_DIR=$$(pwd)/$(@D)", |
| "export TMP_DIR=$$(mktemp -d -t cereal.XXXXX)", |
| "mkdir -p $$TMP_DIR", |
| "cp -R $$(pwd)/external/com_github_cereal/* $$TMP_DIR", |
| "cd $$TMP_DIR", |
| "tar xfz " + package_file, |
| "cd " + package_dir, |
| "$$WORKSPACE_ROOT/$(location //scripts/compile:env_exec) cmake -Wno-dev -DCMAKE_INSTALL_PREFIX:PATH=$$INSTALL_DIR .", |
| "$$WORKSPACE_ROOT/$(location //scripts/compile:env_exec) make install", |
| "rm -rf $$TMP_DIR", |
| ]), |
| tools = [ |
| "//scripts/compile:env_exec", |
| ], |
| ) |
| |
| cc_library( |
| name = "cereal-cxx", |
| srcs = file_list, |
| includes = [ |
| "include", |
| ], |
| linkstatic = 1, |
| ) |