From 92cce874331ac928ab8ab0cd9df7de2172bb341c Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 7 Oct 2020 16:00:06 +0200 Subject: [PATCH] Unit test: Fix qbs build The CLANG_UNIT_TEST macro was set unconditionally. Change-Id: I1a8f16e2e295bda46fc60aab342a74f9675100cc Reviewed-by: Christian Stenger --- tests/unit/unittest/unittest.qbs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/unit/unittest/unittest.qbs b/tests/unit/unittest/unittest.qbs index a25c2ee4f44..5ceb723b220 100644 --- a/tests/unit/unittest/unittest.qbs +++ b/tests/unit/unittest/unittest.qbs @@ -84,7 +84,6 @@ Project { "QT_RESTRICTED_CAST_FROM_ASCII", "QT_USE_FAST_OPERATOR_PLUS", "QT_USE_FAST_CONCATENATION", - "CLANG_UNIT_TESTS", "CLANGPCHMANAGER_STATIC_LIB", "CLANGSUPPORT_BUILD_STATIC_LIB", "CLANGTOOLS_STATIC_LIBRARY", @@ -101,8 +100,11 @@ Project { FileInfo.joinPaths(project.sourceDirectory, "share", "qtcreator")) + '"', 'CPPTOOLS_JSON="' + FileInfo.joinPaths(destinationDirectory, "CppTools.json") + '"', ]; - if (libclang.present && libclang.toolingEnabled) - defines = defines.concat(libclang.llvmToolingDefines); + if (libclang.present) { + defines.push("CLANG_UNIT_TESTS"); + if (libclang.toolingEnabled) + defines = defines.concat(libclang.llvmToolingDefines); + } return defines; } cpp.cxxFlags: {