Compare commits

..

No commits in common. "1e6179e69d8afe9bd95d380f17576474326d6f19" and "05ed63c3eb675709d7f7d71b2b32058943e76ccd" have entirely different histories.

15 changed files with 38 additions and 69 deletions

View file

@ -154,36 +154,31 @@ macos_task_template: &MACOS_TASK_TEMPLATE
LDFLAGS: "-L$QTDIR/lib" LDFLAGS: "-L$QTDIR/lib"
CPPFLAGS: "-I$QTDIR/include" CPPFLAGS: "-I$QTDIR/include"
PKG_CONFIG_PATH: "/opt/homebrew/opt/qt6/lib/pkgconfig" PKG_CONFIG_PATH: "/opt/homebrew/opt/qt6/lib/pkgconfig"
global_homebrew_cache:
folder: "/usr/local/Homebrew"
local_homebrew_cache: local_homebrew_cache:
folder: "$HOME/Library/Caches/Homebrew" folder: "$HOME/Library/Caches/Homebrew"
global_conan_cache:
folder: "$HOME/Library/Caches/Conan"
local_conan_cache:
folder: "~/.conan/data"
pip_cache: pip_cache:
folder: ${PIP_CACHE_DIR} folder: ${PIP_CACHE_DIR}
install_script: install_script:
- brew update > /dev/null - brew update > /dev/null
- brew install qt6 coreutils ccache conan qbs cmake - brew install qt6 coreutils ccache conan qbs
- chmod -R 755 /opt/homebrew/opt/qt6/* - chmod -R 755 /opt/homebrew/opt/qt6/*
- python3 --version - python3 --version
- pip3 install --user --upgrade pip dropbox - pip3 install --user --upgrade pip dropbox
- ccache --set-config=sloppiness=pch_defines,time_macros - ccache --set-config=sloppiness=pch_defines,time_macros
- conan --version
- clang --version - clang --version
- qmake --version - qmake --version
- which qmake - which qmake
- qbs --version - qbs --version
build_script: build_script:
- pwd - pwd
- conan install . -s os=Macos -s os.version=${MACOS_DEPLOYMENT_TARGET} --build=xerces-c
- qbs setup-toolchains --detect - qbs setup-toolchains --detect
- qbs config --list profiles - qbs config --list profiles
- qbs setup-qt /opt/homebrew/opt/qt6/bin/qmake qt6 - qbs setup-qt /opt/homebrew/opt/qt6/bin/qmake qt6
- qbs-config defaultProfile qt6 - qbs-config defaultProfile qt6
- qbs config profiles.qt6.baseProfile clang - qbs config profiles.qt6.baseProfile clang
- 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
- 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 - ccache -s
deploy_script: deploy_script:
- pwd - pwd
@ -200,7 +195,6 @@ macos_task:
QT_BRANCH: Qt6 QT_BRANCH: Qt6
ARCHITECTURE: arm64 ARCHITECTURE: arm64
PLATFORM: "macOS_11+" PLATFORM: "macOS_11+"
MACOS_DEPLOYMENT_TARGET: 11.0
matrix: matrix:
- name: 'macOS Monterey 12 [signle bundle, no tests]' - name: 'macOS Monterey 12 [signle bundle, no tests]'
env: env:

View file

@ -1,15 +0,0 @@
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"]

2
conanfile.txt Normal file
View file

@ -0,0 +1,2 @@
[requires]
xerces-c/[>=3.2,<4.0]

View file

@ -149,9 +149,6 @@ Module {
} }
readonly property string minimumMacosVersion: { readonly property string minimumMacosVersion: {
if (project.minimumMacosVersion !== undefined)
return project.minimumMacosVersion;
// Check which minimal OSX version supports current Qt version // Check which minimal OSX version supports current Qt version
if (Qt.core.versionMajor >= 6) { if (Qt.core.versionMajor >= 6) {
// For Qt 6.5 https://doc-snapshots.qt.io/qt6-6.5/supported-platforms.html // For Qt 6.5 https://doc-snapshots.qt.io/qt6-6.5/supported-platforms.html

View file

@ -98,7 +98,7 @@ Module {
cmd.description = "Copying auxiliary binary into bundle"; cmd.description = "Copying auxiliary binary into bundle";
cmd.highlight = "filegen"; cmd.highlight = "filegen";
const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["application"][0].fileName; const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["dynamiclibrary"][0].fileName;
const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath; const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath;
var data = []; var data = [];
product.multibundle.targetApps.forEach(function(targetApp) { product.multibundle.targetApps.forEach(function(targetApp) {

View file

@ -17,12 +17,6 @@ VToolApp {
targetName: buildconfig.appTarget targetName: buildconfig.appTarget
multibundle.targetApps: ["Valentina"] multibundle.targetApps: ["Valentina"]
Properties {
condition: buildconfig.useConanPackages && buildconfig.enableMultiBundle
conan.XercesC.libInstallDir: qbs.installPrefix + "/" + buildconfig.installLibraryPath
conan.XercesC.installLib: true
}
files: [ files: [
"main.cpp", "main.cpp",
"vpapplication.cpp", "vpapplication.cpp",

View file

@ -21,12 +21,6 @@ VToolApp {
targetName: buildconfig.appTarget targetName: buildconfig.appTarget
multibundle.targetApps: ["Valentina"] multibundle.targetApps: ["Valentina"]
Properties {
condition: buildconfig.useConanPackages && buildconfig.enableMultiBundle
conan.XercesC.libInstallDir: qbs.installPrefix + "/" + buildconfig.installLibraryPath
conan.XercesC.installLib: true
}
files: [ files: [
"main.cpp", "main.cpp",
"tmainwindow.cpp", "tmainwindow.cpp",

View file

@ -32,12 +32,6 @@ VToolApp {
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina" buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina"
targetName: buildconfig.appTarget targetName: buildconfig.appTarget
Properties {
condition: buildconfig.useConanPackages
conan.XercesC.libInstallDir: qbs.installPrefix + "/" + buildconfig.installLibraryPath
conan.XercesC.installLib: true
}
files: [ files: [
"main.cpp", "main.cpp",
"mainwindow.cpp", "mainwindow.cpp",

View file

@ -19,6 +19,11 @@ VLib {
condition: Utilities.versionCompare(Qt.core.version, "6") >= 0 && buildconfig.useConanPackages 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" name: "IFCLib"
files: [ files: [
"ifcdef.h", "ifcdef.h",

View file

@ -190,12 +190,11 @@ void VAbstractConverter::ValidateXML(const QString &schema) const
if (tempSchema->open()) if (tempSchema->open())
{ {
XERCES_CPP_NAMESPACE::XercesDOMParser domParser; XercesDOMParser domParser;
domParser.setErrorHandler(&parserErrorHandler); domParser.setErrorHandler(&parserErrorHandler);
if (domParser.loadGrammar( if (domParser.loadGrammar(
tempSchema->fileName().toUtf8().constData(), tempSchema->fileName().toUtf8().constData(), Grammar::SchemaGrammarType, true) == nullptr)
XERCES_CPP_NAMESPACE::Grammar::SchemaGrammarType, true) == nullptr)
{ {
VException e(parserErrorHandler.StatusMessage()); VException e(parserErrorHandler.StatusMessage());
e.AddMoreInformation(tr("Could not load schema file '%1'.").arg(fileSchema.fileName())); e.AddMoreInformation(tr("Could not load schema file '%1'.").arg(fileSchema.fileName()));
@ -212,7 +211,7 @@ void VAbstractConverter::ValidateXML(const QString &schema) const
throw e; throw e;
} }
domParser.setValidationScheme(XERCES_CPP_NAMESPACE::XercesDOMParser::Val_Always); domParser.setValidationScheme(XercesDOMParser::Val_Always);
domParser.setDoNamespaces(true); domParser.setDoNamespaces(true);
domParser.setDoSchema(true); domParser.setDoSchema(true);
domParser.setValidationConstraintFatal(true); domParser.setValidationConstraintFatal(true);

View file

@ -91,30 +91,30 @@ auto VParserErrorHandler::Column() const -> XMLFileLoc
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VParserErrorHandler::handleMessage(const XERCES_CPP_NAMESPACE::SAXParseException &ex) void VParserErrorHandler::handleMessage(const SAXParseException &ex)
{ {
char* msg = XERCES_CPP_NAMESPACE::XMLString::transcode(ex.getMessage()); char* msg = XMLString::transcode(ex.getMessage());
m_description = QString(msg); m_description = QString(msg);
m_line = ex.getLineNumber(); m_line = ex.getLineNumber();
m_column = ex.getColumnNumber(); m_column = ex.getColumnNumber();
m_hasError = true; m_hasError = true;
XERCES_CPP_NAMESPACE::XMLString::release(&msg); XMLString::release(&msg);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VParserErrorHandler::warning(const XERCES_CPP_NAMESPACE::SAXParseException &ex) void VParserErrorHandler::warning(const SAXParseException &ex)
{ {
handleMessage(ex); handleMessage(ex);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VParserErrorHandler::error(const XERCES_CPP_NAMESPACE::SAXParseException &ex) void VParserErrorHandler::error(const SAXParseException &ex)
{ {
handleMessage(ex); handleMessage(ex);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VParserErrorHandler::fatalError(const XERCES_CPP_NAMESPACE::SAXParseException &ex) void VParserErrorHandler::fatalError(const SAXParseException &ex)
{ {
handleMessage(ex); handleMessage(ex);
} }

View file

@ -61,16 +61,18 @@ private:
#include <xercesc/sax/ErrorHandler.hpp> #include <xercesc/sax/ErrorHandler.hpp>
#include <xercesc/sax/SAXParseException.hpp> #include <xercesc/sax/SAXParseException.hpp>
class VParserErrorHandler : public XERCES_CPP_NAMESPACE::ErrorHandler XERCES_CPP_NAMESPACE_USE
class VParserErrorHandler : public ErrorHandler
{ {
public: public:
auto StatusMessage() const -> QString; auto StatusMessage() const -> QString;
auto Line() const -> XMLFileLoc; auto Line() const -> XMLFileLoc;
auto Column() const -> XMLFileLoc; auto Column() const -> XMLFileLoc;
void warning(const XERCES_CPP_NAMESPACE::SAXParseException& ex) override; void warning(const SAXParseException& ex) override;
void error(const XERCES_CPP_NAMESPACE::SAXParseException& ex) override; void error(const SAXParseException& ex) override;
void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException& ex) override; void fatalError(const SAXParseException& ex) override;
void resetErrors() override; void resetErrors() override;
auto HasError() const -> bool; auto HasError() const -> bool;
@ -81,7 +83,7 @@ private:
QString m_description{}; QString m_description{};
bool m_hasError{false}; bool m_hasError{false};
void handleMessage(const XERCES_CPP_NAMESPACE::SAXParseException& ex); void handleMessage(const SAXParseException& ex);
}; };
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)

View file

@ -40,7 +40,7 @@ namespace
auto InvalidImage() -> QPixmap auto InvalidImage() -> QPixmap
{ {
QImageReader imageReader(VBackgroundPatternImage::brokenImage); QImageReader imageReader(VBackgroundPatternImage::brokenImage);
return QPixmap::fromImageReader(&imageReader); return std::move(QPixmap::fromImageReader(&imageReader));
} }
} }

View file

@ -69,12 +69,11 @@ void ValidateSchema(const QString &schema)
if (tempSchema->open()) if (tempSchema->open())
{ {
XERCES_CPP_NAMESPACE::XercesDOMParser domParser; XercesDOMParser domParser;
domParser.setErrorHandler(&parserErrorHandler); domParser.setErrorHandler(&parserErrorHandler);
if (domParser.loadGrammar( if (domParser.loadGrammar(
tempSchema->fileName().toUtf8().constData(), tempSchema->fileName().toUtf8().constData(), Grammar::SchemaGrammarType, true) == nullptr)
XERCES_CPP_NAMESPACE::Grammar::SchemaGrammarType, true) == nullptr)
{ {
QFAIL(qUtf8Printable(QStringLiteral("%1 Could not load schema file '%2'.") QFAIL(qUtf8Printable(QStringLiteral("%1 Could not load schema file '%2'.")
.arg(parserErrorHandler.StatusMessage(), fileSchema.fileName()))); .arg(parserErrorHandler.StatusMessage(), fileSchema.fileName())));

View file

@ -5,13 +5,17 @@ Project {
minimumQbsVersion: "1.16" minimumQbsVersion: "1.16"
property bool enableConan: false property bool enableConan: false
property string minimumMacosVersion: undefined
Probes.ConanfileProbe { Probes.ConanfileProbe {
id: thirdPartyConanPackages id: thirdPartyConanPackages
condition: enableConan condition: enableConan
conanfilePath: project.sourceDirectory + "/conanfile.py" conanfilePath: project.sourceDirectory + "/conanfile.txt"
verbose: true options: {
if (qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos"))
return ({"xerces-c:shared": "False"});
return ({"xerces-c:shared": "True"});
}
} }
references: [ references: [