Skip to content
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

Allow C# projects to contain multiple file types #8688

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tschoonj
Copy link
Contributor

This allows for linking a C# executable against a C++ .NET assembly that was generated in the same project.

This allows for linking a C# executable against a C++ .NET assembly that was generated in the same project.
@tschoonj tschoonj requested a review from jpakkane as a code owner April 23, 2021 10:17
@tschoonj
Copy link
Contributor Author

This fix is probably too simple, even though it actually fixes my problem...

Any thoughts how this could be improved upon? Basically, linking a C# executable against a DLL should not add a C++ compiler to self.compilers.

@dcbaker dcbaker added the language:C# C# language specific bugs label Apr 23, 2021
@dcbaker
Copy link
Member

dcbaker commented Apr 23, 2021

At the very least we need a test for this, but I'm not even sure how you output .net assembly from c++ and whether what we really need is a donet() target like the jar() target, or what.

@tschoonj
Copy link
Contributor Author

With the patch in this PR I managed to compile the C++ .NET assembly and use it successfully from C#:

https://github.com/tschoonj/xraylib/blob/8c082b576da211ff915222c64e3de2b47c7872d2/csharp/meson.build

@tschoonj
Copy link
Contributor Author

I should be able to come up with a test for this, I will do that when I have some time later.

@tschoonj
Copy link
Contributor Author

It looks to me as if the C++ compiler generates a 32-bit dll, but csc produces a 64-bit executable.

Is there anything I can do to ensure that both produce output for the same architecture?

Thanks!

@tschoonj
Copy link
Contributor Author

@dcbaker any thoughts on how to fix the build?

Thanks!

@dcbaker
Copy link
Member

dcbaker commented Apr 29, 2021

I'll have to think about it some more, i've been putting off getting out my windows machine for a while now, I may have to go ahead and do that.

@tschoonj
Copy link
Contributor Author

Something that surprises me is that vc2017x86ninja appears to be the only build where the C# tests are run, as they are skipped on the other vc build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language:C# C# language specific bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants