Apple Silicon support on 5.15.8
-
Hi,
I'm trying to build a 'universal binary' for my Qt app so it can run natively on arm64 and x86_64.
The only documentation for Silicon integration on 5.15.8 is the last excerpt on this page. The instructions read:
"Some patches already went into Qt 5, so Qt 5.15.4 and above should build and run by passing -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 to configure"
I did that but one of my third party libraries is complaining because it's only built for x86_64. I found a built that has lib files for both x86_64 and arm64 but I need to link the correct ones in my .pro file, depending on the target architecture. I tried testing on 'QMAKE_TARGET.arch' but it just spits out an empty string.
What I'm trying to do is something like this:
# Choose either x86_64 or arm64 ARCH = x86_64 contains(QMAKE_TARGET.arch, arm64) { ARCH = arm64 } # Crashpad libraries LIBS += -L$$EXTERNAL_CRASHPAD_DIR/Crashpad/Libraries/MacOS/$$ARCH -lbase LIBS += -L$$EXTERNAL_CRASHPAD_DIR/Crashpad/Libraries/MacOS/$$ARCH -lcommon LIBS += -L$$EXTERNAL_CRASHPAD_DIR/Crashpad/Libraries/MacOS/$$ARCH -lutil LIBS += -L$$EXTERNAL_CRASHPAD_DIR/Crashpad/Libraries/MacOS/$$ARCH -lclient LIBS += -L$$EXTERNAL_CRASHPAD_DIR/Crashpad/Libraries/MacOS/$$ARCH -lmig_output
How can I make this work?
-
Hi,
Why not just point the L path to the folder containing that library ?
-
Sorry, I misunderstood what you wrote. It sounded like you had found a universal build of that library. In your case, what I would do is use the lipo command to create a universal library from these to separate one and be done with it.