mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-19 23:34:04 +02:00
Compare commits
17 commits
05ed63c3eb
...
1e6179e69d
Author | SHA1 | Date | |
---|---|---|---|
1e6179e69d | |||
824d978473 | |||
51f7c5102d | |||
6b4683d10a | |||
e317836957 | |||
2733a00a40 | |||
b51c028f23 | |||
f3899ac072 | |||
1285f85dbc | |||
3c19d0123d | |||
84529d7b39 | |||
ac84b9f273 | |||
4a022e7f1a | |||
47bb2c16d4 | |||
34632ebb43 | |||
4f2f05fe9a | |||
edccf99f43 |
14
.cirrus.yml
14
.cirrus.yml
|
@ -154,31 +154,36 @@ macos_task_template: &MACOS_TASK_TEMPLATE
|
|||
LDFLAGS: "-L$QTDIR/lib"
|
||||
CPPFLAGS: "-I$QTDIR/include"
|
||||
PKG_CONFIG_PATH: "/opt/homebrew/opt/qt6/lib/pkgconfig"
|
||||
global_homebrew_cache:
|
||||
folder: "/usr/local/Homebrew"
|
||||
local_homebrew_cache:
|
||||
folder: "$HOME/Library/Caches/Homebrew"
|
||||
global_conan_cache:
|
||||
folder: "$HOME/Library/Caches/Conan"
|
||||
local_conan_cache:
|
||||
folder: "~/.conan/data"
|
||||
pip_cache:
|
||||
folder: ${PIP_CACHE_DIR}
|
||||
install_script:
|
||||
- brew update > /dev/null
|
||||
- brew install qt6 coreutils ccache conan qbs
|
||||
- brew install qt6 coreutils ccache conan qbs cmake
|
||||
- chmod -R 755 /opt/homebrew/opt/qt6/*
|
||||
- python3 --version
|
||||
- pip3 install --user --upgrade pip dropbox
|
||||
- ccache --set-config=sloppiness=pch_defines,time_macros
|
||||
- conan --version
|
||||
- clang --version
|
||||
- qmake --version
|
||||
- which qmake
|
||||
- qbs --version
|
||||
build_script:
|
||||
- pwd
|
||||
- conan install . -s os=Macos -s os.version=${MACOS_DEPLOYMENT_TARGET} --build=xerces-c
|
||||
- qbs setup-toolchains --detect
|
||||
- qbs config --list profiles
|
||||
- qbs setup-qt /opt/homebrew/opt/qt6/bin/qmake qt6
|
||||
- qbs-config defaultProfile qt6
|
||||
- qbs config profiles.qt6.baseProfile clang
|
||||
- qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build --command-echo-mode command-line config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true
|
||||
- echo qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build --command-echo-mode command-line config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET}
|
||||
- qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build --command-echo-mode command-line config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET}
|
||||
- ccache -s
|
||||
deploy_script:
|
||||
- pwd
|
||||
|
@ -195,6 +200,7 @@ macos_task:
|
|||
QT_BRANCH: Qt6
|
||||
ARCHITECTURE: arm64
|
||||
PLATFORM: "macOS_11+"
|
||||
MACOS_DEPLOYMENT_TARGET: 11.0
|
||||
matrix:
|
||||
- name: 'macOS Monterey 12 [signle bundle, no tests]'
|
||||
env:
|
||||
|
|
15
conanfile.py
Normal file
15
conanfile.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
import os
|
||||
|
||||
from conans import ConanFile
|
||||
|
||||
class Recipe(ConanFile):
|
||||
settings = "os"
|
||||
requires = "xerces-c/[>=3.2,<4.0]"
|
||||
default_options = {"xerces-c:shared": True}
|
||||
|
||||
def configure(self):
|
||||
if self.settings.os == "Linux":
|
||||
self.options["xerces-c"].shared = False
|
||||
|
||||
if self.settings.os == "Macos" and "MACOS_DEPLOYMENT_TARGET" in os.environ:
|
||||
self.settings.os.version = os.environ["MACOS_DEPLOYMENT_TARGET"]
|
|
@ -1,2 +0,0 @@
|
|||
[requires]
|
||||
xerces-c/[>=3.2,<4.0]
|
|
@ -149,6 +149,9 @@ Module {
|
|||
}
|
||||
|
||||
readonly property string minimumMacosVersion: {
|
||||
if (project.minimumMacosVersion !== undefined)
|
||||
return project.minimumMacosVersion;
|
||||
|
||||
// Check which minimal OSX version supports current Qt version
|
||||
if (Qt.core.versionMajor >= 6) {
|
||||
// For Qt 6.5 https://doc-snapshots.qt.io/qt6-6.5/supported-platforms.html
|
||||
|
|
|
@ -98,7 +98,7 @@ Module {
|
|||
cmd.description = "Copying auxiliary binary into bundle";
|
||||
cmd.highlight = "filegen";
|
||||
|
||||
const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["dynamiclibrary"][0].fileName;
|
||||
const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["application"][0].fileName;
|
||||
const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath;
|
||||
var data = [];
|
||||
product.multibundle.targetApps.forEach(function(targetApp) {
|
||||
|
|
|
@ -17,6 +17,12 @@ VToolApp {
|
|||
targetName: buildconfig.appTarget
|
||||
multibundle.targetApps: ["Valentina"]
|
||||
|
||||
Properties {
|
||||
condition: buildconfig.useConanPackages && buildconfig.enableMultiBundle
|
||||
conan.XercesC.libInstallDir: qbs.installPrefix + "/" + buildconfig.installLibraryPath
|
||||
conan.XercesC.installLib: true
|
||||
}
|
||||
|
||||
files: [
|
||||
"main.cpp",
|
||||
"vpapplication.cpp",
|
||||
|
|
|
@ -21,6 +21,12 @@ VToolApp {
|
|||
targetName: buildconfig.appTarget
|
||||
multibundle.targetApps: ["Valentina"]
|
||||
|
||||
Properties {
|
||||
condition: buildconfig.useConanPackages && buildconfig.enableMultiBundle
|
||||
conan.XercesC.libInstallDir: qbs.installPrefix + "/" + buildconfig.installLibraryPath
|
||||
conan.XercesC.installLib: true
|
||||
}
|
||||
|
||||
files: [
|
||||
"main.cpp",
|
||||
"tmainwindow.cpp",
|
||||
|
|
|
@ -32,6 +32,12 @@ VToolApp {
|
|||
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina"
|
||||
targetName: buildconfig.appTarget
|
||||
|
||||
Properties {
|
||||
condition: buildconfig.useConanPackages
|
||||
conan.XercesC.libInstallDir: qbs.installPrefix + "/" + buildconfig.installLibraryPath
|
||||
conan.XercesC.installLib: true
|
||||
}
|
||||
|
||||
files: [
|
||||
"main.cpp",
|
||||
"mainwindow.cpp",
|
||||
|
|
|
@ -19,11 +19,6 @@ VLib {
|
|||
condition: Utilities.versionCompare(Qt.core.version, "6") >= 0 && buildconfig.useConanPackages
|
||||
}
|
||||
|
||||
Properties {
|
||||
condition: buildconfig.useConan && (qbs.targetOS.contains("macos") || qbs.targetOS.contains("windows"))
|
||||
conan.XercesC.installLib: true
|
||||
}
|
||||
|
||||
name: "IFCLib"
|
||||
files: [
|
||||
"ifcdef.h",
|
||||
|
|
|
@ -190,11 +190,12 @@ void VAbstractConverter::ValidateXML(const QString &schema) const
|
|||
|
||||
if (tempSchema->open())
|
||||
{
|
||||
XercesDOMParser domParser;
|
||||
XERCES_CPP_NAMESPACE::XercesDOMParser domParser;
|
||||
domParser.setErrorHandler(&parserErrorHandler);
|
||||
|
||||
if (domParser.loadGrammar(
|
||||
tempSchema->fileName().toUtf8().constData(), Grammar::SchemaGrammarType, true) == nullptr)
|
||||
tempSchema->fileName().toUtf8().constData(),
|
||||
XERCES_CPP_NAMESPACE::Grammar::SchemaGrammarType, true) == nullptr)
|
||||
{
|
||||
VException e(parserErrorHandler.StatusMessage());
|
||||
e.AddMoreInformation(tr("Could not load schema file '%1'.").arg(fileSchema.fileName()));
|
||||
|
@ -211,7 +212,7 @@ void VAbstractConverter::ValidateXML(const QString &schema) const
|
|||
throw e;
|
||||
}
|
||||
|
||||
domParser.setValidationScheme(XercesDOMParser::Val_Always);
|
||||
domParser.setValidationScheme(XERCES_CPP_NAMESPACE::XercesDOMParser::Val_Always);
|
||||
domParser.setDoNamespaces(true);
|
||||
domParser.setDoSchema(true);
|
||||
domParser.setValidationConstraintFatal(true);
|
||||
|
|
|
@ -91,30 +91,30 @@ auto VParserErrorHandler::Column() const -> XMLFileLoc
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VParserErrorHandler::handleMessage(const SAXParseException &ex)
|
||||
void VParserErrorHandler::handleMessage(const XERCES_CPP_NAMESPACE::SAXParseException &ex)
|
||||
{
|
||||
char* msg = XMLString::transcode(ex.getMessage());
|
||||
char* msg = XERCES_CPP_NAMESPACE::XMLString::transcode(ex.getMessage());
|
||||
m_description = QString(msg);
|
||||
m_line = ex.getLineNumber();
|
||||
m_column = ex.getColumnNumber();
|
||||
m_hasError = true;
|
||||
XMLString::release(&msg);
|
||||
XERCES_CPP_NAMESPACE::XMLString::release(&msg);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VParserErrorHandler::warning(const SAXParseException &ex)
|
||||
void VParserErrorHandler::warning(const XERCES_CPP_NAMESPACE::SAXParseException &ex)
|
||||
{
|
||||
handleMessage(ex);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VParserErrorHandler::error(const SAXParseException &ex)
|
||||
void VParserErrorHandler::error(const XERCES_CPP_NAMESPACE::SAXParseException &ex)
|
||||
{
|
||||
handleMessage(ex);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VParserErrorHandler::fatalError(const SAXParseException &ex)
|
||||
void VParserErrorHandler::fatalError(const XERCES_CPP_NAMESPACE::SAXParseException &ex)
|
||||
{
|
||||
handleMessage(ex);
|
||||
}
|
||||
|
|
|
@ -61,18 +61,16 @@ private:
|
|||
#include <xercesc/sax/ErrorHandler.hpp>
|
||||
#include <xercesc/sax/SAXParseException.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
|
||||
class VParserErrorHandler : public ErrorHandler
|
||||
class VParserErrorHandler : public XERCES_CPP_NAMESPACE::ErrorHandler
|
||||
{
|
||||
public:
|
||||
auto StatusMessage() const -> QString;
|
||||
auto Line() const -> XMLFileLoc;
|
||||
auto Column() const -> XMLFileLoc;
|
||||
|
||||
void warning(const SAXParseException& ex) override;
|
||||
void error(const SAXParseException& ex) override;
|
||||
void fatalError(const SAXParseException& ex) override;
|
||||
void warning(const XERCES_CPP_NAMESPACE::SAXParseException& ex) override;
|
||||
void error(const XERCES_CPP_NAMESPACE::SAXParseException& ex) override;
|
||||
void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException& ex) override;
|
||||
void resetErrors() override;
|
||||
|
||||
auto HasError() const -> bool;
|
||||
|
@ -83,7 +81,7 @@ private:
|
|||
QString m_description{};
|
||||
bool m_hasError{false};
|
||||
|
||||
void handleMessage(const SAXParseException& ex);
|
||||
void handleMessage(const XERCES_CPP_NAMESPACE::SAXParseException& ex);
|
||||
};
|
||||
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace
|
|||
auto InvalidImage() -> QPixmap
|
||||
{
|
||||
QImageReader imageReader(VBackgroundPatternImage::brokenImage);
|
||||
return std::move(QPixmap::fromImageReader(&imageReader));
|
||||
return QPixmap::fromImageReader(&imageReader);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,11 +69,12 @@ void ValidateSchema(const QString &schema)
|
|||
|
||||
if (tempSchema->open())
|
||||
{
|
||||
XercesDOMParser domParser;
|
||||
XERCES_CPP_NAMESPACE::XercesDOMParser domParser;
|
||||
domParser.setErrorHandler(&parserErrorHandler);
|
||||
|
||||
if (domParser.loadGrammar(
|
||||
tempSchema->fileName().toUtf8().constData(), Grammar::SchemaGrammarType, true) == nullptr)
|
||||
tempSchema->fileName().toUtf8().constData(),
|
||||
XERCES_CPP_NAMESPACE::Grammar::SchemaGrammarType, true) == nullptr)
|
||||
{
|
||||
QFAIL(qUtf8Printable(QStringLiteral("%1 Could not load schema file '%2'.")
|
||||
.arg(parserErrorHandler.StatusMessage(), fileSchema.fileName())));
|
||||
|
|
|
@ -5,17 +5,13 @@ Project {
|
|||
minimumQbsVersion: "1.16"
|
||||
|
||||
property bool enableConan: false
|
||||
property string minimumMacosVersion: undefined
|
||||
|
||||
Probes.ConanfileProbe {
|
||||
id: thirdPartyConanPackages
|
||||
condition: enableConan
|
||||
conanfilePath: project.sourceDirectory + "/conanfile.txt"
|
||||
options: {
|
||||
if (qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos"))
|
||||
return ({"xerces-c:shared": "False"});
|
||||
|
||||
return ({"xerces-c:shared": "True"});
|
||||
}
|
||||
conanfilePath: project.sourceDirectory + "/conanfile.py"
|
||||
verbose: true
|
||||
}
|
||||
|
||||
references: [
|
||||
|
|
Loading…
Reference in a new issue