diff options
author | Mike Krus <mike.krus@kdab.com> | 2022-04-19 15:47:10 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2022-04-19 16:08:35 +0100 |
commit | 8adc1cb84bd9a570a9ffa867ca2967a2328134de (patch) | |
tree | 64ecd471198269852ae30c4652574e6929b08c88 | |
parent | 708d8739d391486bc752ce757a72d82c79e70853 (diff) |
Protect code for unsupported configs
With multi-arch macOS code being available now, some code gets
compiled even though the target architecture doesn't support it.
So code needs to be protected with ifdefs
Task-number: QTBUG-99852
Change-Id: Iadcedc6c5014ad01aa4b5d8997e2c994993d973a
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | tests/auto/core/matrix4x4_sse/tst_matrix4x4_sse.cpp | 4 | ||||
-rw-r--r-- | tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp | 4 | ||||
-rw-r--r-- | tests/auto/core/vector4d_sse/tst_vector4d_sse.cpp | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/core/matrix4x4_sse/tst_matrix4x4_sse.cpp b/tests/auto/core/matrix4x4_sse/tst_matrix4x4_sse.cpp index dccf90d10..9bd3afc83 100644 --- a/tests/auto/core/matrix4x4_sse/tst_matrix4x4_sse.cpp +++ b/tests/auto/core/matrix4x4_sse/tst_matrix4x4_sse.cpp @@ -29,7 +29,9 @@ #include <QtTest/QtTest> #include <Qt3DCore/private/matrix4x4_sse_p.h> +#ifdef QT_COMPILER_SUPPORTS_SSE2 using namespace Qt3DCore; +#endif class tst_Matrix4x4_SSE: public QObject { @@ -37,6 +39,7 @@ class tst_Matrix4x4_SSE: public QObject private Q_SLOTS: +#ifdef QT_COMPILER_SUPPORTS_SSE2 void defaultConstruction() { // GIVEN @@ -520,6 +523,7 @@ private Q_SLOTS: QCOMPARE(resultingVec.toQVector3D(), tmpMat.mapVector(tmpVec3)); } } +#endif // QT_COMPILER_SUPPORTS_SSE2 }; QTEST_MAIN(tst_Matrix4x4_SSE) diff --git a/tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp b/tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp index 7ea79a5f5..e99dd0e6f 100644 --- a/tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp +++ b/tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp @@ -29,12 +29,15 @@ #include <QtTest/QtTest> #include <Qt3DCore/private/vector3d_sse_p.h> +#ifdef QT_COMPILER_SUPPORTS_SSE2 using namespace Qt3DCore; +#endif class tst_Vector3D_SSE: public QObject { Q_OBJECT private Q_SLOTS: +#ifdef QT_COMPILER_SUPPORTS_SSE2 void defaultConstruction() { // GIVEN @@ -812,6 +815,7 @@ private Q_SLOTS: QVERIFY(!v0.isNull()); } } +#endif // QT_COMPILER_SUPPORTS_SSE2 }; QTEST_APPLESS_MAIN(tst_Vector3D_SSE) diff --git a/tests/auto/core/vector4d_sse/tst_vector4d_sse.cpp b/tests/auto/core/vector4d_sse/tst_vector4d_sse.cpp index ed9722ffb..2e539491f 100644 --- a/tests/auto/core/vector4d_sse/tst_vector4d_sse.cpp +++ b/tests/auto/core/vector4d_sse/tst_vector4d_sse.cpp @@ -30,12 +30,16 @@ #include <Qt3DCore/private/vector4d_sse_p.h> #include <Qt3DCore/qt3dcore-config.h> +#ifdef QT_COMPILER_SUPPORTS_SSE2 using namespace Qt3DCore; +#endif class tst_Vector4D_SSE: public QObject { Q_OBJECT private Q_SLOTS: + +#ifdef QT_COMPILER_SUPPORTS_SSE2 void defaultConstruction() { // GIVEN @@ -915,6 +919,7 @@ private Q_SLOTS: QVERIFY(!v0.isNull()); } } +#endif // QT_COMPILER_SUPPORTS_SSE2 }; QTEST_APPLESS_MAIN(tst_Vector4D_SSE) |