New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ocamlbuild misses local C #includes #5107
Comments
Comment author: jm Super, ça comble une grosse lacune lorsqu’on fait des liages ;) |
Comment author: Camarade_Tux Thanks for the feedback. I've fixed it and have made a new patch. For the record, cpp can output: edit: you can test behaviour before and after with: |
Comment author: Camarade_Tux I just found out that if there are two files "foo.c" and "foo.h", the .c file will never be picked up (internally, the extension is dropped). There might be a very simple fix: try to copy both, if "foo.*" is being used, chances are both "foo.h" and "foo.c" are used. Unfortunately, but unfortunately I don't have the time to do it right now since I'm on the leave (for a place without a real internet access). edit: that's a problem I had when using lablgtk's varcc, meaning at least one well-know app does that |
Comment author: @xavierleroy Un-assigning from xclerc |
Comment author: @damiendoligez ocamlbuild is now a separate project that lives on GitHub. |
Original bug ID: 5107
Reporter: Camarade_Tux
Status: resolved (set by @damiendoligez on 2017-03-03T15:22:06Z)
Resolution: suspended
Priority: normal
Severity: feature
Version: 3.12.0+beta1 or 3.12.0+rc1
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Tags: patch
Monitored by: abdallah mehdi @hcarty
Bug description
When a .c or .h file uses '#include "foo.h"', ocamlbuild has to copy that file in the _build directory but currently it doesn't, making the build fail.
The attached patch (against today's svn) uses cpp to get these dependencies for .c and .h files: .c files are "allowed" to include .c and .h files while .h files can only include .h files.
The reason for this limitation is that the whole list would be: c, cpp, cxx, cp, C, h, hpp, hxx, hxp, H, CPP, HPP, c++, h++, tcc, hh, cc and I took a conservative approach.
The patch also changes Lexers.ocamldep_output to make it work with cpp's output (or ocamldep without -modules).
File attachments
The text was updated successfully, but these errors were encountered: