8 Commits
Author SHA1 Message Date
Evan WildeandCory Benfield af6be725f5 CMake: Declare ASN1 dependency (#376)
SwiftCrypto depends on SwiftASN1 which is declared in the exports file,
but does not try to find the project, resulting in build failures of
downstream projects that fail to explicitly call
`find_package(SwiftASN1)` before `find_package(SwiftCrypto)`.

Generally, it is recommended that project config files use
`find_dependency` to search for the dependencies of the project they
represent
(https://cmake.org/cmake/help/v3.26/module/CMakeFindDependencyMacro.html).
If the package is already found, either through `find_package` in the
parent project, or through another means, the `find_dependency` call is
a no-op.

Co-authored-by: Cory Benfield <lukasa@apple.com>
2025-07-03 23:14:36 +00:00
Evan Wilde d4d7fefc90 Install swiftmodules with full module triple (#354)
Use full module triple in the installed swiftmodules.

### Motivation:

Clean up how the CMake build installs swiftmodules, using the full
module triple instead of just the architecture. This change uses the
compiler to compute the expected module triple instead of attempting to
compute it in CMake script. This is more maintainable and robust to
adding new platforms and architectures.

### Modifications:

Update the CMake build to query the compiler for the full module triple
instead of attempting to compute it in CMake script.
2025-05-14 08:21:44 +01:00
michael-yuji bce1725222 FreeBSD support (#315)
Fix FreeBSD support

### Checklist
- [x] I've run tests to see all new and existing tests pass
- [x] I've followed the code style of the rest of the project
- [x] I've read the [Contribution Guidelines](CONTRIBUTING.md)
- [x] I've updated the documentation if necessary

### Motivation:
To add FreeBSD support to Swift, we must ensure that swift crypto builds
on FreeBSD since it's a dependency of swiftpm and several essential
packages.

### Modifications:
- `Package.swift` - Ideally FreeBSD should use `.when(platforms:)` to
set the corresponding swift settings and dependencies. However,
`Platform.freebsd` is not yet available on swiftpm and therefore use
guard the settings behind a `isFreeBSD` boolean flag. This is chosen
because it minimize the diff and maintains the maximum readability.
- `cmake/modules/SwiftSupport.cmake` - add `amd64` arch support, maps to
`x86_64`.
- `**/CMakeLists.txt` - Use the Linux assembly files for FreeBSD. Both
Linux and FreeBSD uses SysV ABI, and there're no syscalls involved
(after all, they're supposed to be "pure") so there are no ABI
compatibility problem. After all, all the tests are passing on FreeBSD
with this PR.

### Result:
All the tests (via `swift test`) passed on x86_64 FreeBSD 14.1-p6, and
passed on aarch64 macOS.

Test log available here:
[swift-test-result.txt](https://github.com/user-attachments/files/18147920/swift-test-result.txt)
2024-12-16 12:26:11 +00:00
Franz Busch ae321d29be [CI] Adopt GitHub actions (#280) 2024-10-16 18:04:07 +01:00
Neil Jones 5fb3819b51 add support for riscv64 (#240) 2024-06-17 12:34:29 -07:00
Saleem Abdulrasool 80a6e3edc1 build: add ARM64 spelling for Windows (#148)
Windows uses `ARM64` for the `CMAKE_SYSTEM_PROCESSOR` which does not
match the existing spellings.  Add the special case for Darwin while in
the area.
2023-03-02 12:13:00 -08:00
Yim Lee 42f5ffecd4 Update/Fix CMake build (#65)
Motivation:
SwiftPM's CMake build
(https://github.com/apple/swift-package-manager/pull/3202) unsuccessful
even with https://github.com/apple/swift-crypto/pull/60.

Modifications:
- Use consistent `SWIFT_CRYPTO_EXPORTS` naming. In some places `CRYPTO_EXPORTS` was used instead.
- Install `CCryptoBoringSSL` so we can import it in code (see https://github.com/apple/swift-package-manager/pull/3202)
- Always set `BUILD_SHARED_LIBS`

Result:
Successful CMake build.
2021-01-29 14:09:36 +00:00
47640ada33 Add CMake build files (#60)
Motivation:
This is to support https://github.com/apple/swift-package-manager/pull/3202, which adds swift-crypto as a dependency to SwiftPM.

Modifications:
Add CMake files.

Result:
Can build swift-crypto with cmake.

Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
Co-authored-by: Saleem Abdulrasool <abdulras@google.com>
2021-01-27 20:21:59 +00:00