From 8adc1cb84bd9a570a9ffa867ca2967a2328134de Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Tue, 19 Apr 2022 15:47:10 +0100 Subject: 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 --- tests/auto/core/matrix4x4_sse/tst_matrix4x4_sse.cpp | 4 ++++ tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp | 4 ++++ tests/auto/core/vector4d_sse/tst_vector4d_sse.cpp | 5 +++++ 3 files changed, 13 insertions(+) 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 #include +#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 #include +#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 #include +#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) -- cgit v1.2.3