Unit test: Fix qbs build

The CLANG_UNIT_TEST macro was set unconditionally.

Change-Id: I1a8f16e2e295bda46fc60aab342a74f9675100cc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-10-07 16:00:06 +02:00
parent 1fcac114a3
commit 92cce87433

View File

@@ -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: {