diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-04-01 14:03:55 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-04-03 19:07:28 +0200 |
commit | fcbb78808eea5672f12deb3f15c1fcbf9f0fbdaf (patch) | |
tree | 78502b183038662037fb2f937f837a9e1c4aa62b /src/qml/jit/qv4assemblercommon.cpp | |
parent | 76a7c93f9b860e2f6fde2198edde19a5d704a97f (diff) |
CMake: Disable JIT for arm64 when doing macOS universal builds
Our current approach to building universal macOS Qt is to pass 2 -arch
flags to clang, which underneath spawn 2 clang invocations with each
separate arch and lipo-s the result together.
This approah also meanss that we do only one set of config tests for
the main (first) architecture.
Currently Qml doesn't support JITing for macOS on Apple Silicon
(arm64), but if the first architecture is x86_64, the qml_jit feature
will be set to 'true', and cause compilation errors when trying to
build the arm slice of the jit source files.
To circumvent that, and allow skipping compilation of JIT specific
code, we have to apply the same trick we do in qtbase,
which is to set a compile definition that takes the current
architecture into account, and surround all relevant code with an #if
block taking to account both the feature and current architecture.
Use a custom hacky qt_extra_definition call to redefine the value of
QT_FEATURE_qml_jit based on the original feature value and the current
architecture.
Additionally, surround the jit source files with #if
QT_CONFIG(qml_jit).
Amends 561a2cec9b95b22783a00b48078b532010357066
Task-number: QTBUG-85447
Change-Id: I28b286d218333076223177c456175f180888a667
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jit/qv4assemblercommon.cpp')
-rw-r--r-- | src/qml/jit/qv4assemblercommon.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jit/qv4assemblercommon.cpp b/src/qml/jit/qv4assemblercommon.cpp index a55c7d3851..6952c0b053 100644 --- a/src/qml/jit/qv4assemblercommon.cpp +++ b/src/qml/jit/qv4assemblercommon.cpp @@ -51,6 +51,8 @@ #include <assembler/LinkBuffer.h> #include <WTFStubs.h> +#if QT_CONFIG(qml_jit) + #undef ENABLE_ALL_ASSEMBLERS_FOR_REFACTORING_PURPOSES QT_BEGIN_NAMESPACE @@ -371,3 +373,5 @@ void PlatformAssemblerCommon::storeInt32AsValue(int srcInt, Address destAddr) } // QV4 namepsace QT_END_NAMESPACE + +#endif // QT_CONFIG(qml_jit) |