Skip to content

exposing the mt predicate to dune libraries #1724

@avsm

Description

@avsm

The ctypes port to dune (yallop/ocaml-ctypes#588) is almost working, except for the need to select which subpackage to link based on the -mt predicate in ocamlfind. #96 has some discussion of this, but the specific META file in ctypes is:

package "foreign" (
 version = "0.14.0"
 description = "Dynamic linking of C functions"
 requires(-mt) = "ctypes.foreign.unthreaded"
 requires(mt) = "ctypes.foreign.threaded"

Both the unthreaded and threaded variants have different c stubs, and cannot be linked simultaneously without a module clash. I'm not sure how to make this work without some support for mt in a dune file, as the right package is selected based on whether the executable uses the threads library or not.

Suggestions for workarounds welcome to unblock the ctypes port...

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