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
How to have different implementations for Linux and Windows? #4453
Comments
@mahozad I would recommend reading through https://kotlinlang.org/docs/multiplatform-hierarchy.html#default-hierarchy-template. You can set up your folder structure to have some target specific code via expect/actual. For windows and linux you would need to use the |
Are you sure? I think it's for native targets not jvm targets. Is there any compose multiplatform example? |
There are no separate source sets for JVM on Windows/Linux/macOS; you just switch (at runtime) on the OS. You can use |
@mahozad Sorry, I didn't realize you were trying to do this on the JVM. In that case what m-sasha said is true. There are no separate source sets for JVM targets. Instead, use the |
Yes, checking it in runtime is the default way. If you need different binaries with different code, you can separate your project by different source sets, and include different sources depending on If your project is
|
The above solution by igordmn does not work even though I provided actual declaration in windowsDektopMain source set (with and without
|
How to provide an expect and separate actuals for Linux and Windows?
Because something should be implemented differently depending on the OS.
The text was updated successfully, but these errors were encountered: