Skip to content

Tell to Meson to compile C files with CXX compiler #11603

Answered by eli-schwartz
cprieto asked this question in Q&A
Discussion options

You must be logged in to vote

Does the C language file contain C++ code defining the tests? If so, why not name it .cpp instead?

If it truly only contains C code but is needed in the binary along with a .cpp file containing the test definition, then is it not sufficient to link both the C functions and the C++ test definitions together using a C++ linker? Meson will do that automatically for targets that contain a mixture of C and C++ source files.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@cprieto
Comment options

@eli-schwartz
Comment options

@cprieto
Comment options

@eli-schwartz
Comment options

@cprieto
Comment options

Answer selected by cprieto
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants