Skip to content

Commit

Permalink
macOS universal CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
nohal committed Oct 3, 2023
1 parent 71903c8 commit 5cbff5e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions ci/circleci-build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,21 @@ for pkg in $(sed '/#/d' < $here/../build-deps/macos-deps); do
brew link --overwrite $pkg || brew install $pkg
done

export OPENSSL_ROOT_DIR='/usr/local/opt/openssl'
#Install prebuilt dependencies
wget -q https://dl.cloudsmith.io/public/nohal/opencpn-plugins/raw/files/macos_deps_universal.tar.xz \
-O /tmp/macos_deps_universal.tar.xz
sudo tar -C /usr/local -xJf /tmp/macos_deps_universal.tar.xz

export OPENSSL_ROOT_DIR='/usr/local'

# Build and package
cd build-osx
cmake \
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}" \
-DCMAKE_INSTALL_PREFIX= \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
-DOCPN_TARGET_TUPLE="darwin-wx32;10;x86_64" \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
..

if [[ -z "$CI" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions ci/github-pre-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ case $(uname -s) in

if [ ${USE_HOMEBREW:-0} -ne 1 ]; then
# Install the pre-built wxWidgets package
wget -q https://download.opencpn.org/s/8xYPFAqTR8ZGXXb/download \
-O /tmp/wx322-2_opencpn50_macos1010.tar.bz2
tar -C /tmp -xjf /tmp/wx322-2_opencpn50_macos1010.tar.bz2
wget -q https://dl.cloudsmith.io/public/nohal/opencpn-plugins/raw/files/macos_deps_universal.tar.xz \
-O /tmp/macos_deps_universal.tar.xz
sudo tar -C /usr/local -xJf /tmp/macos_deps_universal.tar.xz
else
brew update
brew install wxwidgets
Expand Down
3 changes: 2 additions & 1 deletion cmake/MacosWxwidgets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
cmake_minimum_required(VERSION 3.20.0)

set(wx_repo https://github.com/wxWidgets/wxWidgets.git)
set(wx_tag v3.2.1)
set(wx_tag v3.2.2.1)

option(IGNORE_SYSTEM_WX "Never use system wxWidgets installation" FALSE)

Expand Down Expand Up @@ -75,6 +75,7 @@ execute_process(
COMMAND
./configure --with-cxx=11 --with-macosx-version-min=10.10 --enable-unicode
--with-osx-cocoa --enable-aui --disable-debug --with-opengl
--enable-macosx_arch=arm64,x86_64 --enable-universal_binary=arm64,x86_64
--without-subdirs --prefix=${cache_dir}
WORKING_DIRECTORY ${wxwidgets_src_dir})
math(_nproc ${OCPN_NPROC} * 2) # Assuming two threads/cpu
Expand Down

0 comments on commit 5cbff5e

Please sign in to comment.