1. 28 Jul, 2017 1 commit
    • Kenton Varda's avatar
      Add new `capnp convert` command with JSON support. · c4c5e404
      Kenton Varda authored
      This supersedes the `capnp encode` and `capnp decode` commands. It didn't make sense to add JSON to those commands since it was unclear if JSON should be thought of as the "encoded" or "decoded" format. `convert` allows mapping anything to anything.
      
      This command is also useful for, say, converting unpacked format to packed format or vice versa, which can now be done without a schema.
      c4c5e404
  2. 09 Jun, 2017 1 commit
    • Neal Gompa's avatar
      Add versioning to the libraries in the CMake build · 7d7847b5
      Neal Gompa authored
      The Autotools and CMake builds are almost the same, except for
      the libraries not being generated as versioned libraries in CMake.
      
      Fixing this lets Linux CMake builds be on the same level as Autotools ones.
      7d7847b5
  3. 22 May, 2017 1 commit
    • Kenton Varda's avatar
      Encapsulate default type ID generation better. · 75845ceb
      Kenton Varda authored
      People see files named "md5" and get worried about security issues, even though we're using it only as a *non-cryptographic* PRNG. So, I renamed the files to type-id.*, encapsulated the code better to make clear that it's only used to generate type IDs, and added comments clarifying that we're not expecting it to be collision-proof.
      
      Fixes #482.
      75845ceb
  4. 29 Apr, 2017 1 commit
    • Harris Hancock's avatar
      Use target_compile_features to request C++11 · 1d0d1c3b
      Harris Hancock authored
      Projects which use Cap'n Proto require C++11, because they must be able to
      compile our headers. Old gcc defaults to C++98, forcing users to manually
      specify the -std=gnu++11 flag in their CMake projects. CMake 3.1
      introduced the target_compile_features command which removes this
      necessity by automatically communicating the C++ standard level
      requirement to client projects.
      
      Specifically, if target `kj` requires a C++11 feature publicly, then all
      targets which link to `kj` will also require that C++11 feature, and get
      the -std=gnu++11 flag for free. If that target is a library, such as
      `kj-async`, and `kj-async` links publicly to `kj`, the requirement is also
      transitive to all targets which link to `kj-async`.
      
      Note that CMake's default behavior is to request compiler-specific
      extensions, such as those provided by the -std=gnu++11 flag. You must
      specifically opt out of these extensions. I'm not aware of any way to
      propagate this nuance in CMake, but added a check to at least prevent
      users from compiling Cap'n Proto without extensions.
      
      With this change, the c++/samples/CMakeLists.txt will build with MinGW
      with no change beyond requiring a later version of CMake.
      1d0d1c3b
  5. 28 Apr, 2017 2 commits
  6. 07 Apr, 2017 1 commit
  7. 24 Jan, 2017 2 commits
    • Harris Hancock's avatar
      Move RawSchema, RawBrandedSchema to raw-schema.h · ecb0c9d6
      Harris Hancock authored
      This is necessary to resolve an MSVC compile error in capability.h:
      
      struct RawSchema;
      extern const RawSchema NULL_INTERFACE_SCHEMA;
      constexpr RawSchema const* schema = &NULL_INTERFACE_SCHEMA;
      
      causes MSVC to complain that `schema` is not initialized by a constant
      expression. Providing the full definition of RawSchema resolves this
      spurious error, so I moved it out of generated-header-support.h and into
      its own raw-schema.h.
      ecb0c9d6
    • Harris Hancock's avatar
      Only build parsing code if we're not using MSVC · 6c7014a2
      Harris Hancock authored
      Disallow MSVC from building the parsing code by default because the latest
      stable MSVC (VS2015 Update 3) ICEs when trying to compile the `anyOfChars`
      combinator.
      
      Note that VS2015 Update 2 and VS2017 can compile the parsing code, with a
      little help. To experiment with this, you can override the default
      behavior with -DCAPNP_BUILD_TOOLS=ON.
      6c7014a2
  8. 19 Nov, 2016 1 commit
  9. 27 Apr, 2016 1 commit
  10. 19 Apr, 2016 5 commits
  11. 11 Apr, 2016 2 commits
    • Alex Richardson's avatar
      7ca97fc0
    • Alex Richardson's avatar
      Add a cmake package config module · f7d685be
      Alex Richardson authored
      This makes it a lot easier for CMake based projects to use Cap'n Proto.
      
      Example usage:
      
      find_package(CapnProto)
      capnp_generate_cpp(FOO_SRCS FOO_HDRS foo.capnp)
      add_executable(foo main.cpp ${FOO_SRCS})
      target_link_libraries(foo CapnProto::capnp CapnProto::capnp-rpc)
      
      This is a lot better than the previous variable based solution since
      linking to nonexistent targets is an error whereas an empty variable
      expansion (e.g. due to typos) will be silently ignored. It also makes
      sure that the right compiler flags, include directories, defines and
      link libraries are passed to the compiler for that target without
      needing any other include_directories(), etc.
      f7d685be
  12. 29 Mar, 2016 1 commit
  13. 20 Mar, 2016 1 commit
    • Matthew Maurer's avatar
      Add Canonicalization · 5db2c8f8
      Matthew Maurer authored
      The user facing API is in MessageReader and MessageBuilder
      
      {MessageBuilder,MessageReader}::isCanonical verifies the canonicity of a
      message. This is both useful for debugging and for knowing if a received
      message can be used for hashes, bytewise equality, etc.
      
      MessageBuilder::canonicalRoot(Reader) can be used to write a canonical
      message on a best effort basis, and checks itself using isCanonical.
      It should succeed as long as the MessageBuilder in question:
      * Has a first segment which is long enough to contain the message
      * Has not been used before
      
      Tests have been added in canonicalize-test.c++ which verify that for
      crafted examples of canonicalization errors, isCanonical will reject,
      and for a canonicalized version of the standard test message, it will
      accept.
      5db2c8f8
  14. 28 Sep, 2015 1 commit
  15. 08 Jul, 2015 1 commit
  16. 22 Jun, 2015 1 commit
  17. 29 May, 2015 1 commit
  18. 25 Feb, 2015 1 commit
  19. 30 Dec, 2014 1 commit
  20. 12 Dec, 2014 1 commit
  21. 06 Nov, 2014 1 commit
  22. 01 Nov, 2014 1 commit
  23. 29 Oct, 2014 2 commits