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
wish that ocamlopt compile .cpp files as well as c files #5823
Comments
Comment author: @damiendoligez Your patch won't work because you failed to change the calls to "chop_suffix". Also, this would change the requirements on configure from "find a C compiler" to "find something that can indifferently compile C and C++". I'm not sure if that is a big deal or not, but it has to be considered. |
Comment author: daweil No, that's not a big deal, but just a nice feature if ocaml & ocamlbuild can handle both C and C++ files... |
Comment author: @ygrek if this is to be implemented, please consider also .cxx and .cc extensions.. |
Comment author: @whitequark This patch is not enough because it won't link the C++ standard library. The only remotely portable way to do so is to remember whether C++ files were used during compiling and invoke g++ (or equivalent) instead of gcc (or equivalent) during linking. Alternatively you could try detecting how the standard library is named (nontrivial; current OS X has two) and putting it in cma's autolink flags, but I'm not sure if that's a simpler choice. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Can be closed as duplicate, since the attached patch has significant flaws. |
Original bug ID: 5823
Reporter: daweil
Status: acknowledged (set by @damiendoligez on 2014-06-04T19:57:35Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.00.1
Category: compiler driver
Tags: patch
Has duplicate: #6798
Monitored by: @whitequark @ygrek
Bug description
I tried the following very simple patch that seems to work :
and add the following rule for ocamlbuild:
The text was updated successfully, but these errors were encountered: