Properly compiling modules in subfolders (ocamlbuild)

前端 未结 2 1632
面向向阳花
面向向阳花 2021-02-14 10:42

I recently decided to organize the files in my project directory. I moved the parsers I had for a few different file types into their own directory and also decided to use ocaml

相关标签:
2条回答
  • 2021-02-14 11:18

    You need to "include" the parser directory in the search path. You can do this in _tags:

    "parser": include
    

    Then ocamlbuild can search the parser directory for interesting files.

    0 讨论(0)
  • 2021-02-14 11:25

    I wonder if parser.mli is somehow interfering with the dependencies in processing the mlpack file. parser.cmi will be generated from the pack operation when parser.mlpack is processed and compiled. Try building with the parser.mli file removed. If that works, then this can be re-processed into a real answer.

    Also, you don't need parser/ as a prefix to your modules in parser.mlpack if parser.mlpack is in the parser directory and you have the include tag set. But that shouldn't make a difference for this.

    Update: this worked around the problem, but wasn't the root cause. Root cause, per comment below, was a file mentioned in the .mlpack that had been relocated.

    0 讨论(0)
提交回复
热议问题