Reputation: 163
I am targeting my Rust project for Windows and Linux.
On Windows, the code needs to be linked to an executable, whereas on Linux - as a shared library.
To link the project as a Linux shared library, I added the following section to Cargo.toml
:
[lib]
name = "my_project_name"
crate-type = ["cdylib"]
However that results in shared library generated on Windows, too.
Is there a way to tell Rust compiler to link the project as executable on Windows and as a library on Linux?
Upvotes: 2
Views: 680
Reputation: 2533
As far as I can see it's not possible to do so right now. Closest information I could find was this for a similar use case.
Upvotes: 1