2023-01-04 17:31:50 +01:00
|
|
|
import qbs.FileInfo
|
|
|
|
|
|
|
|
Library {
|
|
|
|
Depends { name: "buildconfig" }
|
2023-01-28 07:07:12 +01:00
|
|
|
Depends { name: "bundle"; condition: qbs.targetOS.contains("macos") }
|
2023-01-04 17:31:50 +01:00
|
|
|
Depends { name: "cpp" }
|
|
|
|
|
|
|
|
type: buildconfig.staticBuild ? "staticlibrary" : "dynamiclibrary"
|
|
|
|
|
2023-01-27 18:07:24 +01:00
|
|
|
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina"
|
2023-01-04 17:31:50 +01:00
|
|
|
cpp.includePaths: [".."]
|
2023-01-09 11:16:36 +01:00
|
|
|
|
|
|
|
// Allow MAC OS X to find library inside a bundle
|
|
|
|
cpp.sonamePrefix: (!buildconfig.staticBuild && qbs.targetOS.contains("macos")) ? "@rpath" : undefined
|
|
|
|
|
|
|
|
Properties {
|
|
|
|
condition: (!buildconfig.staticBuild && buildconfig.enableRPath)
|
|
|
|
cpp.rpaths: cpp.rpathOrigin
|
|
|
|
}
|
2023-01-04 17:31:50 +01:00
|
|
|
|
2023-01-09 16:29:40 +01:00
|
|
|
Properties {
|
|
|
|
condition: qbs.targetOS.contains("unix") && buildconfig.buildWithCcache
|
|
|
|
cpp.compilerWrapper: "ccache"
|
|
|
|
}
|
|
|
|
|
2023-03-08 17:48:30 +01:00
|
|
|
cpp.cxxLanguageVersion: {
|
|
|
|
if (Qt.core.versionMajor >= 6) // Start building with C++20 since Qt 6.0
|
|
|
|
return "c++20";
|
2024-01-23 14:57:23 +01:00
|
|
|
return "c++17";
|
2023-03-08 17:48:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Properties {
|
|
|
|
condition: qbs.targetOS.contains("windows") && qbs.toolchain.contains("gcc") && !qbs.toolchain.contains("clang")
|
|
|
|
cpp.minimumWindowsVersion: {
|
|
|
|
if (Qt.core.versionMajor >= 6)
|
|
|
|
return "6.02"; // should be 10.0
|
|
|
|
|
2024-01-23 14:57:23 +01:00
|
|
|
return "6.00";
|
2023-03-08 17:48:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-27 18:07:24 +01:00
|
|
|
install: false
|
|
|
|
installDebugInformation: false
|
2023-01-04 17:31:50 +01:00
|
|
|
|
|
|
|
Properties {
|
|
|
|
condition: qbs.targetOS.contains("macos")
|
|
|
|
cpp.minimumMacosVersion: buildconfig.minimumMacosVersion
|
2023-01-28 07:07:12 +01:00
|
|
|
bundle.isBundle: buildconfig.frameworksBuild
|
2023-01-04 17:31:50 +01:00
|
|
|
}
|
2023-02-16 19:01:38 +01:00
|
|
|
|
|
|
|
Group {
|
|
|
|
name: "Precompiled headers"
|
|
|
|
condition: buildconfig.enablePCH
|
|
|
|
prefix: product.sourceDirectory + "/"
|
|
|
|
files: {
|
|
|
|
var files = ["stable.h"];
|
2023-02-26 10:22:25 +01:00
|
|
|
// if (qbs.toolchain.contains("msvc"))
|
|
|
|
// files.push("stable.cpp")
|
2023-02-16 19:01:38 +01:00
|
|
|
return files;
|
|
|
|
}
|
|
|
|
fileTags: ["cpp_pch_src"]
|
|
|
|
}
|
2023-08-08 17:17:19 +02:00
|
|
|
|
|
|
|
Export {
|
|
|
|
Depends { name: "buildconfig" }
|
|
|
|
}
|
2023-01-04 17:31:50 +01:00
|
|
|
}
|