Skip to content

Commit

Permalink
Build universal binaries
Browse files Browse the repository at this point in the history
WE2-800

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma committed Aug 11, 2023
1 parent d13ffd6 commit 63efa1d
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions .github/workflows/cmake-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
BUILD_TYPE: RelWithDebInfo
BUILD_DIR: build
BUILD_NUMBER: ${{github.run_number}}
OPENSSL_ROOT_DIR: /usr/local/opt/openssl@3.0
OPENSSL_ROOT_DIR: ${{ github.workspace }}/openssl-binary
QT_QPA_PLATFORM: offscreen
MAKEFLAGS: -j3
MACOSX_DEPLOYMENT_TARGET: 10.15
Expand All @@ -21,8 +21,29 @@ jobs:
with:
submodules: recursive

- name: Install libraries
run: brew install web-eid/gtest/gtest
- name: Build GTest
run: |
git clone --depth=1 https://github.com/google/googletest.git
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_CXX_STANDARD=17 -S googletest -B gtest-build
cmake --build gtest-build --target install
- name: Build OpenSSL
run: |
git clone --depth=1 https://github.com/openssl/openssl.git -b openssl-3.0
cd openssl
for ARCH in x86_64 arm64; do
./Configure darwin64-${ARCH} --prefix=${OPENSSL_ROOT_DIR} no-shared no-module no-tests enable-ec_nistp_64_gcc_128
MAKEFLAGS=-j1 make -s install_sw
mv ${OPENSSL_ROOT_DIR}{,.${ARCH}}
make distclean
done
cd -
cp -a ${OPENSSL_ROOT_DIR}{.x86_64,}
cd ${OPENSSL_ROOT_DIR}.arm64
for i in lib/lib*3.dylib; do
lipo -create ${OPENSSL_ROOT_DIR}.x86_64/${i} ${i} -output ${OPENSSL_ROOT_DIR}/${i}
done
cd -
- name: Install Qt
uses: jurplel/install-qt-action@v3
Expand All @@ -31,16 +52,16 @@ jobs:
arch: clang_64

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

- name: Build
run: |
cmake --build ${BUILD_DIR} --config ${BUILD_TYPE}
cmake --build ${BUILD_DIR} --config ${BUILD_TYPE} --target installer
cmake --build ${BUILD_DIR} --config ${BUILD_TYPE} --target installer-safari
#- name: Test
# run: ctest -V -C ${BUILD_TYPE} --test-dir ${BUILD_DIR}
- name: Test
run: ctest -V -C ${BUILD_TYPE} --test-dir ${BUILD_DIR}

- name: Upload artifacts
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 63efa1d

Please sign in to comment.