diff options
Diffstat (limited to 'src/lib/corelib/corelib.qbs')
-rw-r--r-- | src/lib/corelib/corelib.qbs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/lib/corelib/corelib.qbs b/src/lib/corelib/corelib.qbs index f33c483da..358e6e353 100644 --- a/src/lib/corelib/corelib.qbs +++ b/src/lib/corelib/corelib.qbs @@ -14,14 +14,19 @@ QbsLibrary { ".", "../.." // for the plugin headers ]) - property stringList enableUnitTestsDefines: - qbsbuildconfig.enableUnitTests ? ["QBS_ENABLE_UNIT_TESTS"] : [] - property stringList systemSettingsDirDefines: qbsbuildconfig.systemSettingsDir - ? ['QBS_SYSTEM_SETTINGS_DIR="' + qbsbuildconfig.systemSettingsDir + '"'] : [] - cpp.defines: base.concat([ - "QBS_RELATIVE_LIBEXEC_PATH=" + Utilities.cStringQuote(qbsbuildconfig.relativeLibexecPath), - "QBS_VERSION=" + Utilities.cStringQuote(version), - ]).concat(enableUnitTestsDefines).concat(systemSettingsDirDefines) + cpp.defines: { + var defines = base.concat([ + "QBS_RELATIVE_LIBEXEC_PATH=" + Utilities.cStringQuote(qbsbuildconfig.relativeLibexecPath), + "QBS_VERSION=" + Utilities.cStringQuote(version), + ]); + if (project.withTests) + defines.push("QBS_WITH_TESTS"); + if (qbsbuildconfig.enableUnitTests) + defines.push("QBS_ENABLE_UNIT_TESTS"); + if (qbsbuildconfig.systemSettingsDir) + defines.push('QBS_SYSTEM_SETTINGS_DIR="' + qbsbuildconfig.systemSettingsDir + '"'); + return defines; + } Properties { condition: qbs.targetOS.contains("windows") |