-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Support targetType 'wasm' #1541
Conversation
|
I don't think that it should be implemented as It'd be better to add |
|
I think the end goal of having full support for cross-compilation should be achieved as follows:
|
|
@ZombineDev imo vendor doesn't make any sense in there. What could it possibly add that sys and abi not already describe? |
|
@WebFreak001 the idea is to adapt a standard, well-known format and not invent our own.
|
|
@ZombineDev can we use something else than these triples then? Well if dub had a way to list all possible triple combinations it would be ok but otherwise it's just even worse than when using clang then. I mean otherwise even for your example triple combinations it would be basically impossible to find them out without looking them up somewhere online. That's like such a huge pain with these triples which is why I don't like them. |
|
@WebFreak001 I think thís is a bit beside the point. If you want to cross compile to such a platform, you need to know the triple, no matter what the format is. On the other hand, for native compilation the existing architecture flag is going to stay, so the additional complexity won't show up. Of course, we could define our own identifiers that map to such triples to simplify that, but then we could also just put up a documentation page with common triples. Also, the list would grow to a point where it will be just as hard to find out the right identifier for a given target system. |
|
hm ok I can see advantages in regards with LDC compatibility. On DMD I guess it could be somewhat interpreted for some settings. But if we have these triples how is dub going to decide on the build steps then? Especially linking will require different tools and different arguments potentially for every triple. I think there should definitely be some documentation page with common triples and some custom identifiers mapping to some. Also about the suggested triples: Also I think having |
Good question. It depends on the compiler used. LDC's config file supports specifying details like this per target triple in its configuration file. So in the most basic case Dub will call LDC and LDC will handle the rest. AFAIU, for GDC you will have a cross-compiler for each target platform installed in a different folder.
Yes, definitely.
Just to clarify: I didn't invent any of those triples (except for the
For vendor: as mentioned before most of the time you probably wouldn't need to specify it as the compiler will infer the right thing from the OS field. But it's there for those who might need it. Not specifying the vendor or typing unknown explicitly should always be safe as it means the compiler will either determine the right thing automatically, or make as few assumptions as possible when the OS is not specified - useful for platform bring up and/or bare metal development. |
|
Superseeded by #1755 ? |
|
Yes;
that works now with master. |
|
I can build to the wasm, so I close this PR. |
WebAssembly is supported with LDC 1.11.0.
If wasm is added to the targetType, I think that development becomes easier.
I wrote such a code. How about that?