Skip to content

Commit 2725dd1

Browse files
metsmamrts
authored andcommitted
Build universal binaries
WE2-800 Signed-off-by: Raul Metsma <[email protected]>
1 parent b69da23 commit 2725dd1

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

.github/workflows/cmake-macos.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
BUILD_TYPE: RelWithDebInfo
77
BUILD_DIR: build
88
BUILD_NUMBER: ${{github.run_number}}
9-
OPENSSL_ROOT_DIR: /usr/local/opt/openssl@3.0
9+
OPENSSL_ROOT_DIR: ${{ github.workspace }}/openssl-binary
1010
QT_QPA_PLATFORM: offscreen
1111
MAKEFLAGS: -j3
1212
MACOSX_DEPLOYMENT_TARGET: 10.15
@@ -21,8 +21,29 @@ jobs:
2121
with:
2222
submodules: recursive
2323

24-
- name: Install libraries
25-
run: brew install web-eid/gtest/gtest
24+
- name: Build GTest
25+
run: |
26+
git clone --depth=1 https://github.com/google/googletest.git
27+
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_CXX_STANDARD=17 -S googletest -B gtest-build
28+
cmake --build gtest-build --target install
29+
30+
- name: Build OpenSSL
31+
run: |
32+
git clone --depth=1 https://github.com/openssl/openssl.git -b openssl-3.0
33+
cd openssl
34+
for ARCH in x86_64 arm64; do
35+
./Configure darwin64-${ARCH} --prefix=${OPENSSL_ROOT_DIR} no-shared no-module no-tests enable-ec_nistp_64_gcc_128
36+
MAKEFLAGS=-j1 make -s install_sw
37+
mv ${OPENSSL_ROOT_DIR}{,.${ARCH}}
38+
make distclean
39+
done
40+
cd -
41+
cp -a ${OPENSSL_ROOT_DIR}{.x86_64,}
42+
cd ${OPENSSL_ROOT_DIR}.arm64
43+
for i in lib/lib*.*; do
44+
lipo -create ${OPENSSL_ROOT_DIR}.x86_64/${i} ${i} -output ${OPENSSL_ROOT_DIR}/${i}
45+
done
46+
cd -
2647
2748
- name: Install Qt
2849
uses: jurplel/install-qt-action@v3
@@ -31,7 +52,7 @@ jobs:
3152
arch: clang_64
3253

3354
- name: Configure
34-
run: cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -B ${BUILD_DIR} -S .
55+
run: cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -B ${BUILD_DIR} -S .
3556

3657
- name: Build
3758
run: |

0 commit comments

Comments
 (0)