Skip to content

Commit 8f4bfa5

Browse files
compnerdLukasa
andauthored
scripts: update scripts for Windows support (apple#57)
Add support for Windows for vending BoringSSL. This is required in order to build SwiftCrypto for Windows. Co-authored-by: Cory Benfield <[email protected]>
1 parent 0effb70 commit 8f4bfa5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

scripts/build-asm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
('linux', 'x86', 'elf', ['-fPIC', '-DOPENSSL_IA32_SSE2'], 'S'),
2929
('linux', 'x86_64', 'elf', [], 'S'),
3030
('mac', 'x86_64', 'macosx', [], 'S'),
31+
# ('windows', 'aarch64', 'coff', [], 'S'),
32+
# ('windows', 'arm', 'coff', [], 'S'),
33+
('windows', 'x86', 'coff', [], 'S'),
34+
# ('windows', 'x86_64', 'coff', [], 'S'),
3135
]
3236

3337

@@ -167,6 +171,8 @@ def preprocessor_platform_for_os(osname):
167171
return '__APPLE__'
168172
elif osname == 'linux':
169173
return '__linux__'
174+
elif osname == 'windows':
175+
return '_WIN32'
170176

171177

172178
def asm_target(osname, arch, asm):

scripts/vendor-boringssl.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ mangle_symbols
241241
echo "REMOVING assembly on 32-bit Apple platforms"
242242
gsed -i "/#define OPENSSL_HEADER_BASE_H/a#if defined(__APPLE__) && defined(__i386__)\n#define OPENSSL_NO_ASM\n#endif" "$DSTROOT/include/openssl/base.h"
243243

244+
# Remove assembly on non-x86 Windows
245+
echo "REMOVING assembly on non-x86 Windows"
246+
gsed -i "/#define OPENSSL_HEADER_BASE_H/a#if defined(_WIN32) && !(defined(_M_IX86) || defined(__i386__))\n#define OPENSSL_NO_ASM\n#endif" "$DSTROOT/include/openssl/base.h"
247+
244248
echo "RENAMING header files"
245249
(
246250
# We need to rearrange a coouple of things here, the end state will be:

0 commit comments

Comments
 (0)