Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS universal support #26

Open
thefat32 opened this issue May 17, 2023 · 2 comments
Open

MacOS universal support #26

thefat32 opened this issue May 17, 2023 · 2 comments

Comments

@thefat32
Copy link

thefat32 commented May 17, 2023

I've built universal .app using my own universal build of openssl 3.1 and qt 5.15.9. I don't have an M1 mac so you are welcome to test and report. This issue is intended to keep track of work that needs to be done to create an universal build.

Link

# OpenSSL

$ git clone https://github.com/openssl/openssl.git
$ cd openssl
$ git checkout --force -b openssl-3.1 --track origin/openssl-3.1
$ git submodule update --init --recursive --force
$ mkdir build
$ cd build
$ ../Configure darwin64-arm64 --release --prefix=/Users/<username>/install/arm64/openssl
$ make -j8
$ make -j8 install_sw
$ make clean
$ ../Configure darwin64-x86_64 --release --prefix=/Users/<username>/install/x86_64/openssl
$ make -j8
$ make -j8 install_sw
$ cd /Users/<username>/install
$ mkdir -p universal/openssl/lib
$ cp -r x86_64/openssl/include universal/openssl/include
$ lipo -create arm64/openssl/lib/libcrypto.a x86_64/openssl/lib/libcrypto.a -output universal/openssl/lib/libcrypto.a
$ lipo -create arm64/openssl/lib/libssl.a x86_64/openssl/lib/libssl.a -output universal/openssl/lib/libssl.a

# Qt 5.15.9
# Download https://download.qt.io/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz

$ gunzip qt-everywhere-opensource-src-5.15.9.tar.gz
$ tar xvf qt-everywhere-opensource-src-5.15.9.tar
$ cd qt-everywhere-opensource-src-5.15.9
$ ./configure QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64"  -release -prefix=/Users/<username>/install/universal/qt5
$ make -j8
$ make -j8 install

Add in Scripts/Build/BuildDarwin.sh

-D CMAKE_OSX_ARCHITECTURES="arm64;x86_64" \

Then follow normal install instructions and use own compiled libs in config

[Darwin]

   libQtPath   = /Users/<username>/install/universal/qt5
   openSSLPath = /Users/<username>/install/universal/openssl
@DominikDeak
Copy link
Member

Awesome work mate. Thanks for giving this a shot. I'll port this to the build scripts when I get some free time.

@thefat32
Copy link
Author

Building Qt is time expensive so I think that if you want to add support for building universal .app we need to upload prebuilt binaries somewhere it could be downloaded by build scripts.

Also if you're planning to build Qt 5.15.9 in Ventura (SDK 13) take a look at this issue. Ventura is not a tested platform for Qt5 and I needed to do that one line addition mentioned in the issue to build full Qt 5.15.9.

When you decide how you would like to integrate universal build onto your project I can help.

Have a nice weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants