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

Add config option to skip idlcxx building if crosscompiling #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtudan
Copy link
Contributor

@mtudan mtudan commented Dec 10, 2021

Skip idlcxx module building if crosscompiling. A native one should
be used in that case.

Signed-off-by: Matija Tudan [email protected]

Skip idlcxx module building if crosscompiling. A native one should
be used in that case.

Signed-off-by: Matija Tudan <[email protected]>
@ichernev
Copy link
Contributor

This is somewhat similar to #183, but it also has some support in the Generate.cmake. Can you explain what the idea is? If cross compiling to include the native generator with the cross-compiled lib? @k0ekk0ek is that what you have in mind? It would make sense to not include it as well (in my use case I have to support multiple native and multiple "cross" architectures, so it doesn't make sense to bundle any one with the other, just have them separate).

@mtudan
Copy link
Contributor Author

mtudan commented Dec 14, 2021

Like @k0ekk0ek mentioned in #183, the idea was to implement the same thing like in cyclonedds repo (commit a614bdebe0626326bad2d40e84adba937ec42a8f).

But, after discussing with @eboasson in #191, we will implement more generic function in cyclonedds repo and use it in this C++ repo. So, this PR (#189) will probably be closed and not merged in favor a new one. Which also means that your PR #183 will probably be merged.

@k0ekk0ek
Copy link
Contributor

Combining them may not be the best way forward. I previously thought about the same thing but C++ is really different from C. I'm happy to review or provide input of course, but back then I thought it would introduce more problems then it solves. An example: C++ currently only generates a header, not a source file and a header like C. I know that'll change when X-Types lands, but still. Other than that, without having properly reviewed it yet, this seems like what I had in mind.

@ichernev
Copy link
Contributor

C++ currently only generates a header

This is not true anymore (after #178 is merged). I'm hoping it's on the final straight :)

@ichernev
Copy link
Contributor

ichernev commented Dec 20, 2021

To be fair, about the C++ generation (and about idlc supporting multiple languages), it makes sense most options to be "bookkeeping" and apply to all languages, and if there are language-specific options it makes a lot of sense for them to be prefixed with the language (like --cxx-XXXXX ,or --python-XXXX or --c-XXXXX), so it is easy for plugins to list options that don't collide with other plugins, and easy for the base idlc to figure out which options go where.

Update: If at a later point some language-specific options are found to be present across multiple languages, then a 2nd variant --lang-XXXX that just means "pass to the respective language" can be used. But only if that is the case, currently there are no options (and it makes sense to keep options to a minimum).

@k0ekk0ek
Copy link
Contributor

Hi @ichernev, that's actually sort-of how it's implemented already. Options that apply to the parser or all backends are kept by the compiler, each backend can then add options (and annotations) that apply only to that backend. e.g. the C++ backend supports the use of custom containers for unions etc.

@wjbbupt
Copy link

wjbbupt commented Oct 24, 2022

Excuse me, how did you compile the cross-compilation? I didn't find any relevant information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants