Skip to content

Better support for C++ #3528

@ghost

Description

Right now, OCaml uses the compiler specified in the c_compiler field of ocamlc -config to compile C++ sources. We rely on the C compiler detecting the .cpp extension to decide that the language is C++. This works ok with gcc, but doesn't work so well with other C compilers such as clang.

As a result, people who are compiling C++ stubs with Dune have to manually add -x c++ -lstdc++ to their compilation flags, which is not ideal. Instead, we would like Dune to do this automatically. Since the flags are not the same for all C compilers, we will need to construct a small database with the flags for various well-known C compilers.

Metadata

Metadata

Assignees

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