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 support for Windows x64 platform #1

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

Conversation

fiedukow
Copy link

This adds support for Windows x64 to swift-sodium.

This is achieved by:

  • Adding windows 1.0.19 release of https://github.com/jedisct1/libsodium to the repo - similarly to how .a files are present for mac. Note, only x64, only v143 and only static variant is added as that's the only tested combination. This is added under Clibsodium-win
  • FIXING the above release by moving sodium/crypto_onetimeauth_poly1305.h includes outside of extern "C" block as it supposed to be, it seems that this mistake was present in only this one file, but it was preventing compilation in Cxx interop mode.
  • Providing specialized definition of Clibsodium target based on the above.
  • Providing SODIUM_STATIC define for the target, to ensure static linkage of the library.
  • Add extra linker path to test target so it can work.

This was tested by:

  • Running swift test on this repo on windows.
  • Adding this as dependency to arc project and checking that it properly links and produces same hashes as on macOS.

Package.swift Show resolved Hide resolved
Package.swift Show resolved Hide resolved
Package.swift Show resolved Hide resolved
@fiedukow
Copy link
Author

Probably worth changing the name of the path to libsodium.

This would be out of what upstream uses.

@compnerd
Copy link

Probably worth changing the name of the path to libsodium.

This would be out of what upstream uses.

Not sure I understand how this would be different from upstream. The local path that we use has no relation to what upstream does right?

Copy link

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit on the naming of the local path, but I don't think that is worth blocking this on.

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.

2 participants