Skip to content

Building both static and shared library? #598

Open

Description

@Grinnz

I see from the changelog that the cmake BUILD_SHARED_LIBS flag is now used to determine whether a static .a or shared .so is built. But previously, both would be built by default, and I don't see how to do this with BUILD_SHARED_LIBS, as when I define the option only the shared .so is built. I need to build both for my Perl extension so that it can be statically linked to XS code as well as dynamically used in FFI code.

Activity

  1. Grinnz commented on Jan 7, 2026

    @Grinnz
    Author

    Additionally if both CMARK_STATIC and CMARK_SHARED options are set it only builds the static library as it does by default.

  2. jgm commented on Jan 7, 2026

    @jgm
    Member

    Changelog says:

    • Remove the CMARK_STATIC and CMARK_SHARED options as one of the two
      must be enabled always as the cmark executable depends on the library.
      Instead of having a custom flag to discern between the
      library type, use the native CMake option BUILD_SHARED_LIBS,
      allowing the user to control which library to build. This matches
      CMake recommendations to only build a single copy of the library.

    So I guess this was a deliberate decision to conform to recommendations to build only a single copy at a time. I don't really know the motivation for this. @nwellnhof may remember more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions