Compare commits

...

12 commits

Author SHA1 Message Date
Roman Telezhynskyi 9145b9638b Fix ReferenceError: Can't find variable: FileInfo. 2023-02-28 10:46:31 +02:00
Roman Telezhynskyi c89544fe08 Start building with C++20 since Qt 6.0 2023-02-28 10:45:58 +02:00
Roman Telezhynskyi dce2061dc3 Incorrect syntax for Windows. 2023-02-28 10:31:37 +02:00
Roman Telezhynskyi a9ffeebe83 Install MinGW 12.2 to bypass error with default compiler. 2023-02-28 10:24:39 +02:00
Roman Telezhynskyi 94f88b1066 Imitate QTextCodec::codecForLocale(). 2023-02-28 10:14:14 +02:00
Roman Telezhynskyi 934781660a QWinTaskbarButton not available since Qt 6. 2023-02-28 10:13:18 +02:00
Roman Telezhynskyi bf60cb02b1 Set environment variable on Windows to be able to run autotests. 2023-02-27 12:04:44 +02:00
Roman Telezhynskyi 60d8833fb0 No need to install cmake. 2023-02-26 21:06:54 +02:00
Roman Telezhynskyi 58f8e01f76 Fixes. 2023-02-26 20:43:28 +02:00
Roman Telezhynskyi 7debd364ce Check if msvc will work without stable.cpp. 2023-02-26 20:21:07 +02:00
Roman Telezhynskyi 0c24aeaaed Use the same name across all builds. 2023-02-26 14:58:23 +02:00
Roman Telezhynskyi 85a59a617f Fix conan profile. 2023-02-26 14:54:29 +02:00
8 changed files with 91 additions and 41 deletions

View file

@ -44,20 +44,25 @@ environment:
- job_name: Windows_Qt_6_4_(GCC_x64)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
COMPILER: mingw
COMPILER_CPPSTD: gnu17
COMPILER_LIBCXX: libstdc++11
QT: Qt\6.4\mingw_64
QT_VERSION: Qt6_4
BUILD_SYSTEM: "qbs"
ENABLE_PCH: false
GCC_VERSION: 11.2
MINGW_PATH: C:\Qt\Tools\mingw810_64\bin
GCC_VERSION: 12.2
MINGW_PATH: C:\msys64\mingw64\bin
ARCH: x64
PYTHON: "C:\\Python311-x64"
PLATFORM: "Windows10+"
MSYS2_PACKAGES: true
DEPLOY: true
- job_name: Windows_Qt_5_15_(qbs_GCC_x86)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
COMPILER: mingw
COMPILER_CPPSTD: gnu17
COMPILER_LIBCXX: libstdc++11
QT: Qt\5.15\mingw81_32
QT_VERSION: Qt5_15
BUILD_SYSTEM: "qbs"
@ -67,6 +72,7 @@ environment:
ARCH: x86
PYTHON: "C:\\Python311"
PLATFORM: "Windows7+"
MSYS2_PACKAGES: false
DEPLOY: true
- job_name: Windows_Qt_5_6_(GCC_x86)
@ -89,7 +95,7 @@ environment:
BUILD_SYSTEM: "qbs"
ARCH: x64
XCODE_VERSION: 13.4.1
PLATFORM: "macOS11+"
PLATFORM: "macOS_11+"
MACOS_DEPLOYMENT_TARGET: 11.0
MULTI_BUNDLE: true
ENABLE_CONAN: true
@ -103,7 +109,7 @@ environment:
BUILD_SYSTEM: "qbs"
ARCH: x64
XCODE_VERSION: 13.4.1
PLATFORM: "macOS11+"
PLATFORM: "macOS_11+"
MACOS_DEPLOYMENT_TARGET: 11.0
MULTI_BUNDLE: false
ENABLE_CONAN: true
@ -160,6 +166,7 @@ environment:
ARCH: x64
PYTHON: "C:\\Python311-x64"
PLATFORM: "Windows10+"
MSYS2_PACKAGES: false
DEPLOY: false
- job_name: Windows_Qt_6_4_(MSVC_arm64)
@ -173,11 +180,14 @@ environment:
ARCH: arm64
PYTHON: "C:\\Python311-x64"
PLATFORM: "Windows10+"
MSYS2_PACKAGES: false
DEPLOY: false
- job_name: Windows_Qt_5_15_(qbs_GCC_x64)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
COMPILER: mingw
COMPILER_CPPSTD: gnu17
COMPILER_LIBCXX: libstdc++11
QT: Qt\5.15\mingw81_64
QT_VERSION: Qt5_15
BUILD_SYSTEM: "qbs"
@ -187,6 +197,7 @@ environment:
ARCH: x64
PYTHON: "C:\\Python311-x64"
PLATFORM: "Windows7+"
MSYS2_PACKAGES: false
DEPLOY: false
- job_name: Windows_Qt_5_15_(qbs_MSVC_x64)
@ -200,6 +211,7 @@ environment:
ARCH: x64
PYTHON: "C:\\Python311-x64"
PLATFORM: "Windows7+"
MSYS2_PACKAGES: false
DEPLOY: false
- job_name: Windows_Qt_5_15_(make_GCC_x64)
@ -332,6 +344,10 @@ for:
}
}
} else {
if ($env:MSYS2_PACKAGES -eq "true") {
& 'C:\msys64\usr\bin\bash' -lc "pacman --noconfirm -Syuu"
& 'C:\msys64\usr\bin\bash' -lc "pacman --noconfirm -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make"
}
$env:Path += ";$env:MINGW_PATH"
$env:CC = "gcc.exe"
$env:CXX = "g++.exe"
@ -347,6 +363,7 @@ for:
# Trick qmake to not work through MSYS
- del /F "C:\Program Files\Git\usr\bin\sh.exe"
- del /F "C:\Program Files\Git\bin\sh.exe"
- dir "%QTDIR%\bin"
- qmake.exe -v
- qbs --version
@ -380,8 +397,8 @@ for:
& qbs-setup-toolchains.exe --type mingw $env:MINGW_PATH\g++.exe $env:COMPILER
& qbs-config.exe profiles.qt6.baseProfile $env:COMPILER
& conan profile update settings.compiler=gcc valentina
& conan profile update settings.compiler.cppstd=gnu17 valentina
& conan profile update settings.compiler.libcxx=libstdc++11 valentina
& conan profile update settings.compiler.cppstd=$env:COMPILER_CPPSTD valentina
& conan profile update settings.compiler.libcxx=$env:COMPILER_LIBCXX valentina
& conan profile update settings.compiler.version=$env:GCC_VERSION valentina
}
- qbs-config --list profiles
@ -424,9 +441,9 @@ for:
if ($env:COMPILER -eq "msvc") {
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2022") {
if ($env:ARCH -eq "x64") {
& "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
& "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
} else {
& "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat"
& "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat"
}
} elseif ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2019") {
if ($env:ARCH -eq "x64") {
@ -442,10 +459,10 @@ for:
}
} elseif ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") {
if ($env:ARCH -eq "x64") {
'& "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64'
'& "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64'
& "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
& "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
} else {
'& "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86'
& "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
}
}
}
@ -506,11 +523,7 @@ for:
- sudo xcode-select -s /Applications/Xcode-$XCODE_VERSION.app
- sudo xcode-select -p
- brew update > /dev/null
- rm '/usr/local/bin/ccmake'
- rm '/usr/local/bin/cmake'
- rm '/usr/local/bin/cpack'
- rm '/usr/local/bin/ctest'
- brew install --force coreutils qbs cmake
- brew install --force qbs
- export QTDIR="${HOME}/${QT}"
- export PATH="$QTDIR/bin:$HOME/.local/bin:`python3 -m site --user-base`/bin:$PATH"
- echo $PATH

View file

@ -93,8 +93,8 @@ CppApplication {
prefix: product.sourceDirectory + "/"
files: {
var files = ["stable.h"];
if (qbs.toolchain.contains("msvc"))
files.push("stable.cpp")
// if (qbs.toolchain.contains("msvc"))
// files.push("stable.cpp")
return files;
}
fileTags: ["cpp_pch_src"]

View file

@ -138,14 +138,12 @@ Module {
cpp.visibility: "minimal"
Properties {
condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor < 12
cpp.cxxLanguageVersion: "c++11"
}
// Since Qt 5.12 available support for C++17
Properties {
condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12
cpp.cxxLanguageVersion: "c++17"
cpp.cxxLanguageVersion: {
if (Qt.core.versionMajor >= 6) // Start building with C++20 since Qt 6.0
return "c++20";
else if(Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12) // Since Qt 5.12 available support for C++17
return "c++17";
return "c++11";
}
readonly property string minimumMacosVersion: {

View file

@ -216,7 +216,7 @@
#include <QUuid>
#include <chrono>
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#include <QWinTaskbarButton>
#include <QWinTaskbarProgress>
#endif
@ -361,7 +361,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui->actionAddBackgroundImage, &QAction::triggered, this, &MainWindow::ActionAddBackgroundImage);
m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(false);
#endif
m_statusLabel->setText(tr("Create new pattern piece to start working."));
@ -1750,7 +1750,7 @@ void MainWindow::showEvent( QShowEvent *event )
return;
}
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarButton->setWindow(windowHandle());
#endif
@ -4095,7 +4095,7 @@ void MainWindow::Clear()
m_toolOptions->ClearPropertyBrowser();
m_toolOptions->itemClicked(nullptr);
m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(false);
#endif
m_statusLabel->setVisible(true);
@ -4510,7 +4510,7 @@ void MainWindow::ShowProgress()
{
const int newValue = m_progressBar->value() + 1;
m_progressBar->setValue(newValue);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setValue(newValue);
#endif
QCoreApplication::processEvents();
@ -6059,7 +6059,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
m_progressBar->setValue(0);
const int elements = doc->ElementsToParse();
m_progressBar->setMaximum(elements);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(true);
m_taskbarProgress->setMaximum(elements);
#endif
@ -6067,7 +6067,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
FullParseFile();
m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(false);
#endif
m_statusLabel->setVisible(true);

View file

@ -128,13 +128,13 @@ MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
: VAbstractMainWindow(parent),
pattern(new VContainer(VAbstractApplication::VApp()->TrVars(), VAbstractValApplication::VApp()->patternUnitsP(),
valentinaNamespace))
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
,m_taskbarButton(new QWinTaskbarButton(this))
#endif
{
InitTempLayoutScene();
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarButton->setWindow(this->windowHandle());
m_taskbarProgress = m_taskbarButton->progress();
m_taskbarProgress->setMinimum(0);
@ -186,14 +186,14 @@ bool MainWindowsNoGUI::GenerateLayout(VLayoutGenerator& lGenerator)
QElapsedTimer timer;
timer.start();
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QTimer *progressTimer = nullptr;
#endif
QSharedPointer<DialogLayoutProgress> progress;
if (VApplication::IsGUIMode())
{
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(true);
m_taskbarProgress->setValue(0);
m_taskbarProgress->setMaximum(lGenerator.GetNestingTime()*60);
@ -402,7 +402,7 @@ bool MainWindowsNoGUI::GenerateLayout(VLayoutGenerator& lGenerator)
progress->Finished();
}
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
if (VApplication::IsGUIMode())
{
progressTimer->stop();

View file

@ -47,7 +47,7 @@ struct PosterData;
class QGraphicsRectItem;
class VMeasurements;
#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
class QWinTaskbarButton;
class QWinTaskbarProgress;
#endif
@ -119,7 +119,7 @@ protected:
QSharedPointer<DialogSaveLayout> m_dialogSaveLayout{};
#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QWinTaskbarButton *m_taskbarButton;
QWinTaskbarProgress *m_taskbarProgress{nullptr};
#endif

View file

@ -1265,7 +1265,7 @@ auto VDxfEngine::FromUnicodeToCodec(const QString &str, VTextCodec *codec) -> st
auto VDxfEngine::GetFileNameForLocale() const -> std::string
{
#if defined(Q_OS_WIN)
return VDxfEngine::FromUnicodeToCodec(m_fileName, QTextCodec::codecForLocale());
return VDxfEngine::FromUnicodeToCodec(m_fileName, VTextCodec::codecForName("System"));
#else
return m_fileName.toStdString();
#endif

View file

@ -1,3 +1,5 @@
import qbs.FileInfo
import "qbs/imports/conan/ConanfileProbe.qbs" as ConanfileProbe
Project {
@ -33,6 +35,43 @@ Project {
if (qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")) {
env.push("LD_LIBRARY_PATH=" + qbs.installRoot + qbs.installPrefix + "/" + buildconfig.libDirName + "/valentina");
}
else if (qbs.targetOS.contains("windows")) {
// PATH
var path = "";
for (var i = 0; i < env.length; ++i) {
if (env[i].startsWith("PATH=")) {
path = env[i].substring(5);
break;
}
}
var fullInstallDir = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix);
if (path.length === 0) {
path = fullInstallDir;
} else {
path = fullInstallDir + ";" + path;
}
var arrayElem = "PATH=" + path;
if (i < env.length)
env[i] = arrayElem;
else
env.push(arrayElem);
// QT_QPA_PLATFORM_PLUGIN_PATH
for (var i = 0; i < env.length; ++i) {
if (env[i].startsWith("QT_QPA_PLATFORM_PLUGIN_PATH=")) {
break;
}
}
if (i >= env.length) {
var pluginsPath = "QT_QPA_PLATFORM_PLUGIN_PATH=" + Qt.core.pluginPath
env.push(pluginsPath);
}
console.info("env_after: " + env);
}
return env;
}
}