-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cross-compilation on macOS with SDK and ARCH (#849)
* Fix cross-compilation on macOS with SDK and ARCH Surprisingly, it's possible to cross-compile Themis Core for different SDKs and architectures using our Makefile. For example, make SDK=macosx11.0 ARCH=arm64 will compile for Apple Silicon, provided that your Xcode toolchain is actually capable of building that architecture. You also need to have OpenSSL binaries with desired architecture installed (for which you might need to tweak ENGINE_INCLUDE_PATH and ENGINE_LIB_PATH separately). Or build ENGINE=boringssl to use embedded BoringSSL that we can cross-compile too. However, cross-compilation does not work because the architecture and system library directories are not set at link time, so libthemis.dylib it attempted to be linked for the native target which does not work. Pass proper settings to LDFLAGS at configuration time so that cross-compilation has a chance to work. * Pass cross-compilation options to embedded BoringSSL build If we seem to be cross-compiling, tell CMake what SDK it should use and what architecture it should be building. It knows what to do next. * Test cross-compilation on GitHub Actions Throw in a job to make sure that cross-compilations stays in working order. Unfortunately, we can't actually run unit tests, but hey, at least it compiles.
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters