Skip to content

CMake build support #62

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

Closed
wants to merge 6 commits into from
Closed

CMake build support #62

wants to merge 6 commits into from

Conversation

compnerd
Copy link
Contributor

[One line description of your change]

Checklist

  • I've run tests to see all new and existing tests pass
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

If you've made changes to gyb files

  • I've run .script/generate_boilerplate_files_with_gyb and included updated generated files in a commit of this pull request

Motivation:

[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]

Modifications:

[Describe the modifications you've done.]

Result:

[After your change, what will change.]

@compnerd
Copy link
Contributor Author

@yim-lee this gets further but fails due to the need for the module map which needs to be added.

@compnerd
Copy link
Contributor Author

cmake -B out -D BUILD_SHARED_LIBS=YES -D CMAKE_BUILD_TYPE=Release -D CMAKE_Swift_COMPILER=S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe -D CMAKE_Swift_FLAGS="-sdk S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" -G Ninja -S .
ninja -C out

Works for me with this set. It should work on Linux and macOS as well, but I haven't tested it.

@compnerd compnerd mentioned this pull request Jan 22, 2021
yim-lee and others added 6 commits January 21, 2021 18:56
Motivation:
This is to support swiftlang/swift-package-manager#3202, which adds swift-crypto as a dependency to SwiftPM.

Modifications:
Add CMake files.

Result:
Can build swift-crypto with cmake.
Windows requires that `WIN32_LEAN_AND_MEAN` is defined.  This replicates
the behaviour from `Package.swift`.
The include path for static libraries does not seem to propagate via the
`link_libraries` for other static libraries (and Swift libraries).  This
explicitly passes them along to resolve header search paths.
This adds modulemaps to allow building with CMake.
@compnerd compnerd changed the title CMake CMake build support Jan 22, 2021
@yim-lee
Copy link
Member

yim-lee commented Jan 22, 2021

Thanks @compnerd. I've cherry-picked your commits to #60. Closing this.

@yim-lee yim-lee closed this Jan 22, 2021
rnro added a commit to rnro/swift-crypto that referenced this pull request Mar 26, 2025
Enable MemberImportVisibility check on all targets. Use a standard
string header and footer to bracket the new block for ease of updating
in the future with scripts.
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