Warning, /sdk/cutehmi/qbs/imports/cutehmi/CppExtension.qbs is written in an unsupported language. File is not indexed.
0001 import qbs 0002 import qbs.FileInfo 0003 0004 import "Extension.qbs" as Extension 0005 0006 /** 0007 C++ extension product. This item sets up properties for extensions that use C++ code (either if C++ code is going to be used for a 0008 library or QML plugin, or both). 0009 0010 @note Set `type` explicitly to `[]` if the library contains only header files. Otherwise Qbs `cpp` module will trigger a linker. 0011 */ 0012 Extension { 0013 type: project.buildBinaries ? (project.staticExtensions ? ["staticlibrary"] : ["dynamiclibrary"]) : [] 0014 0015 targetName: name 0016 Properties { 0017 condition: qbs.targetOS.contains("windows") 0018 targetName: name + (qbs.buildVariant.contains("debug") ? "d" : "") 0019 } 0020 Properties { 0021 condition: qbs.targetOS.contains("android") 0022 targetName: "android_" + name 0023 } 0024 0025 extensionType: "cpp" 0026 0027 property string macroName: baseName.toUpperCase().replace(/\./g, '_') 0028 0029 Export { 0030 cpp.defines: { 0031 var defines = [exportingProduct.macroName + "_" + exportingProduct.major + "_" + exportingProduct.minor] 0032 if (!project.staticExtensions) 0033 defines.push(exportingProduct.macroName + "_DYNAMIC") 0034 if (project.buildTests) 0035 defines.push(exportingProduct.macroName + "_TEST") 0036 return defines 0037 } 0038 0039 //<qbs-cutehmi.cpp-1.workaround target="Qbs" cuase="missing"> 0040 // Qbs does not allow Export within Module items. Using 'cutehmi.cpp.exportedIncludePaths' property to export include paths. 0041 cpp.includePaths: exportingProduct.cutehmi.cpp.exportedIncludePaths 0042 // Instead of: 0043 // cpp.includePaths: [sourceDirectory + "/include"] 0044 //</qbs-cutehmi.cpp-1.workaround> 0045 0046 Depends { name: "cpp" } 0047 0048 Depends { 0049 name: "android_" + exportingProduct.name 0050 condition: importingProduct.cutehmiType == "tool" && qbs.targetOS.contains("android") 0051 cpp.link: false 0052 } 0053 } 0054 0055 Depends { name: "cpp" } 0056 Properties { 0057 condition: qbs.targetOS.contains("linux") 0058 cpp.linkerFlags: "-rpath=$ORIGIN" 0059 } 0060 cpp.defines: { 0061 var defines = [macroName + "_BUILD"] 0062 if (!project.staticExtensions) 0063 defines.push(macroName + "_DYNAMIC") 0064 if (project.buildTests) 0065 defines.push(macroName + "_TESTS") 0066 return base.concat(defines) 0067 } 0068 cpp.includePaths: [ 0069 product.sourceDirectory + "/" + cutehmi.conventions.functions.includesSubdir(product.name), 0070 cutehmi.dirs.externalIncludeDir 0071 ] 0072 cpp.libraryPaths: [cutehmi.dirs.externalLibDir] 0073 0074 Depends { name: "cutehmi.cpp" } 0075 //<qbs-cutehmi.cpp-1.workaround target="Qbs" cuase="missing"> 0076 // Qbs does not allow Export within Module items. Using 'cutehmi.cpp.exportedIncludePaths' property to export include paths. 0077 cutehmi.cpp.exportedIncludePaths: [ 0078 sourceDirectory + "/include", 0079 buildDirectory + "/include" 0080 ] 0081 //</qbs-cutehmi.cpp-1.workaround> 0082 0083 Group { 0084 name: "Library" 0085 fileTagsFilter: "dynamiclibrary" 0086 qbs.install: true 0087 qbs.installDir: cutehmi.dirs.extensionsInstallSubdir 0088 } 0089 } 0090 0091 //(c)C: Copyright © 2019-2024, Michał Policht <michal@policht.pl>. All rights reserved. 0092 //(c)C: SPDX-License-Identifier: LGPL-3.0-or-later OR MIT 0093 //(c)C: This file is a part of CuteHMI. 0094 //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 0095 //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 0096 //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see <https://www.gnu.org/licenses/>. 0097 //(c)C: Additionally, this file is licensed under terms of MIT license as expressed below. 0098 //(c)C: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 0099 //(c)C: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 0100 //(c)C: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.