added engraving check build project
This commit is contained in:
parent
6a6fcd5e16
commit
b1c8cc5631
20 changed files with 322 additions and 35 deletions
|
@ -43,11 +43,11 @@ if (NOT PROJECT_ROOT_DIR)
|
|||
set(PROJECT_ROOT_DIR ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
if (MODULE_QRC)
|
||||
if (MODULE_QRC AND NOT NO_QT_SUPPORT)
|
||||
qt5_add_resources(RCC_SOURCES ${MODULE_QRC})
|
||||
endif()
|
||||
|
||||
if (MODULE_BIG_QRC)
|
||||
if (MODULE_BIG_QRC AND NOT NO_QT_SUPPORT)
|
||||
qt5_add_big_resources(RCC_BIG_SOURCES ${MODULE_BIG_QRC})
|
||||
endif()
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include "../libmscore/staff.h"
|
||||
#include "../libmscore/part.h"
|
||||
|
||||
#include "context/uicontext.h"
|
||||
|
||||
#include "translation.h"
|
||||
|
||||
using namespace mu::engraving;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
namespace mu::draw {
|
||||
static constexpr int fromHex(uint c);
|
||||
static int hex2int(const char* s, int n);
|
||||
static bool getHexRgb(const char* name, size_t len, mu::draw::Rgba* rgba);
|
||||
static bool getHexRgb(const char* name, size_t len, Rgba* rgba);
|
||||
static std::string rgb2hex(int r, int g, int b, int a = Color::DEFAULT_ALPHA);
|
||||
static std::string rgb2hex(Rgba rgba);
|
||||
static constexpr bool isValidComp(int num);
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
#ifndef MU_DRAW_COLOR_H
|
||||
#define MU_DRAW_COLOR_H
|
||||
|
||||
#include <string>
|
||||
#include "rgba.h"
|
||||
|
||||
#ifndef NO_QT_SUPPORT
|
||||
#include <QColor>
|
||||
#endif
|
||||
|
||||
#include "rgba.h"
|
||||
|
||||
namespace mu::draw {
|
||||
class Color
|
||||
{
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#ifndef MU_DRAW_RGBA_H
|
||||
#define MU_DRAW_RGBA_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace mu::draw {
|
||||
using Rgba = uint32_t;
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include "io/file.h"
|
||||
#include "io/fileinfo.h"
|
||||
|
||||
#include "infrastructure/draw/iimageprovider.h"
|
||||
|
||||
#include "draw/pixmap.h"
|
||||
#include "draw/transform.h"
|
||||
#include "draw/svgrenderer.h"
|
||||
|
|
|
@ -24,13 +24,12 @@
|
|||
#define __IMAGE_H__
|
||||
|
||||
#include "modularity/ioc.h"
|
||||
|
||||
#include "infrastructure/draw/iimageprovider.h"
|
||||
#include "bsymbol.h"
|
||||
|
||||
namespace mu::draw {
|
||||
class Pixmap;
|
||||
class SvgRenderer;
|
||||
class IImageProvider;
|
||||
}
|
||||
|
||||
namespace mu::engraving {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "modularity/ioc.h"
|
||||
#include "diagnostics/iengravingelementsprovider.h"
|
||||
#include "iengravingconfiguration.h"
|
||||
#include "ui/iuiconfiguration.h"
|
||||
|
||||
namespace mu::engraving {
|
||||
class EngravingItem;
|
||||
|
|
|
@ -22,13 +22,9 @@
|
|||
#ifndef MU_ENGRAVING_PAINT_H
|
||||
#define MU_ENGRAVING_PAINT_H
|
||||
|
||||
#include <list>
|
||||
|
||||
#include <vector>
|
||||
#include "infrastructure/draw/painter.h"
|
||||
|
||||
#include "modularity/ioc.h"
|
||||
#include "ui/iuiconfiguration.h"
|
||||
|
||||
namespace mu::engraving {
|
||||
class EngravingItem;
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include "containers.h"
|
||||
#include "textstream.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include "log.h"
|
||||
|
||||
using namespace mu;
|
||||
|
|
|
@ -3,22 +3,6 @@
|
|||
#include <iostream>
|
||||
#include <cassert>
|
||||
|
||||
#ifdef HAW_LOGGER_QT_SUPPORT
|
||||
#define USE_QT_DIR
|
||||
#include <QDir>
|
||||
#else
|
||||
// #if __has_include(<filesystem>)
|
||||
// #include <filesystem>
|
||||
// namespace fs = std::filesystem;
|
||||
// #elif __has_include(<experimental/filesystem>)
|
||||
// #include <experimental/filesystem>
|
||||
// namespace fs = std::experimental::filesystem;
|
||||
// #else
|
||||
// #error compiler must either support c++17
|
||||
// #endif
|
||||
#error At moment supported only with Qt
|
||||
#endif
|
||||
|
||||
using namespace haw::logger;
|
||||
|
||||
MemLogDest::MemLogDest(const LogLayout& l)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <ctime>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdarg>
|
||||
|
||||
#include "logdefdest.h"
|
||||
#include "helpful.h"
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
//#ifndef NO_QT_SUPPORT
|
||||
#ifndef GLOBAL_NO_QT_SUPPORT
|
||||
#include <QByteArray>
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
namespace mu {
|
||||
class ByteArray
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
ByteArray left(size_t len) const;
|
||||
ByteArray right(size_t len) const;
|
||||
|
||||
//#ifndef NO_QT_SUPPORT
|
||||
#ifndef GLOBAL_NO_QT_SUPPORT
|
||||
static ByteArray fromQByteArray(const QByteArray& ba)
|
||||
{
|
||||
return ByteArray(reinterpret_cast<const uint8_t*>(ba.constData()), ba.size());
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
return QByteArray::fromRawData(reinterpret_cast<const char*>(constData()), static_cast<int>(size()));
|
||||
}
|
||||
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
private:
|
||||
using Data = std::vector<uint8_t>;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <locale>
|
||||
#include <cctype>
|
||||
#include <iomanip>
|
||||
#include <QStringList>
|
||||
|
||||
#include "global/thirdparty/utfcpp-3.2.1/utf8.h"
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <string>
|
||||
#include <string_view>
|
||||
#include <regex>
|
||||
#include <QString>
|
||||
|
||||
#include "containers.h"
|
||||
#include "bytearray.h"
|
||||
|
|
82
tools/check_build_without_qt/CMakeLists.txt
Normal file
82
tools/check_build_without_qt/CMakeLists.txt
Normal file
|
@ -0,0 +1,82 @@
|
|||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(engraving_app LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
#set(CMAKE_AUTOUIC ON)
|
||||
#set(CMAKE_AUTOMOC ON)
|
||||
#set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(MU_ROOT ${CMAKE_CURRENT_LIST_DIR}/../..)
|
||||
set(PROJECT_ROOT_DIR ${MU_ROOT})
|
||||
|
||||
set(CMAKE_MODULE_PATH
|
||||
${MU_ROOT}/build
|
||||
${MU_ROOT}/build/cmake
|
||||
${CMAKE_MODULE_PATH}
|
||||
)
|
||||
|
||||
include(SetupBuildEnvironment)
|
||||
include(GetPlatformInfo)
|
||||
|
||||
set(QT_MIN_VERSION "5.15.0")
|
||||
#find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED)
|
||||
#find_package(Qt5Gui ${QT_MIN_VERSION} REQUIRED)
|
||||
|
||||
set(QT_LIBRARIES
|
||||
# Qt5::Core
|
||||
# Qt5::Gui
|
||||
)
|
||||
|
||||
include_directories(
|
||||
# ${Qt5Core_INCLUDE_DIRS}
|
||||
# ${Qt5Gui_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${MU_ROOT}/thirdparty/dtl
|
||||
)
|
||||
|
||||
set(THIRDPARTY_DIR ${MU_ROOT}/thirdparty)
|
||||
|
||||
add_definitions(
|
||||
-DNO_QT_SUPPORT
|
||||
-DGLOBAL_NO_QT_SUPPORT
|
||||
-DNO_ENGRAVING_INTERACTIVE
|
||||
-DNO_ENGRAVING_QSVGRENDER
|
||||
-DNO_ENGRAVING_QTEXTDOCUMENT
|
||||
-DHAW_LOGGER_QT_SUPPORT
|
||||
)
|
||||
|
||||
set(NO_QT_SUPPORT ON)
|
||||
set(NO_ENGRAVING_INTERNAL ON)
|
||||
add_subdirectory(${MU_ROOT}/src/engraving engraving)
|
||||
|
||||
set(NO_GLOBAL_INTERNAL ON)
|
||||
add_subdirectory(${MU_ROOT}/src/framework/global global)
|
||||
|
||||
|
||||
add_executable(engraving_app
|
||||
fontproviderstub.cpp
|
||||
fontproviderstub.h
|
||||
main.cpp
|
||||
)
|
||||
|
||||
set_target_properties(engraving PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
set_target_properties(global PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
set_target_properties(engraving_app PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
|
||||
target_include_directories(engraving_app PUBLIC
|
||||
${MU_ROOT}/src/framework
|
||||
${MU_ROOT}/src/framework/global
|
||||
${MU_ROOT}/src
|
||||
${MU_ROOT}/src/engraving
|
||||
)
|
||||
|
||||
target_link_libraries(engraving_app
|
||||
${QT_LIBRARIES}
|
||||
global
|
||||
engraving
|
||||
)
|
78
tools/check_build_without_qt/config.h
Normal file
78
tools/check_build_without_qt/config.h
Normal file
|
@ -0,0 +1,78 @@
|
|||
//=============================================================================
|
||||
// MusE
|
||||
// Linux Music Editor
|
||||
//
|
||||
// Copyright (C) 2002-2010 by Werner Schweer and others
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2.
|
||||
//
|
||||
// This program 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 General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//=============================================================================
|
||||
|
||||
#ifndef MUSESCORE_CONFIG_H
|
||||
#define MUSESCORE_CONFIG_H
|
||||
|
||||
/* #undef FOR_WINSTORE */
|
||||
|
||||
#define MSCORE_UNSTABLE
|
||||
|
||||
/* #undef HAS_MIDI */
|
||||
// #define SCRIPT_INTERFACE
|
||||
/* #undef HAS_AUDIOFILE */
|
||||
|
||||
#define CRASH_REPORT_URL ""
|
||||
#define MUSESCORE_NAME_VERSION "MuseScore 4 (4.0.0 unstable)"
|
||||
#define MUSESCORE_REVISION ""
|
||||
#define INSTALL_NAME "mscore-4.0/"
|
||||
#define INSTPREFIX "/home/igor/Dev/MuseScore/build.debug/install"
|
||||
#define VERSION "4.0.0"
|
||||
#define VERSION_LABEL "Development"
|
||||
#define BUILD_NUMBER ""
|
||||
#define SPARKLE_APPCAST_URL ""
|
||||
|
||||
#define BUILD_SHORTCUTS_MODULE
|
||||
#define BUILD_SYSTEM_MODULE
|
||||
#define BUILD_NETWORK_MODULE
|
||||
#define BUILD_AUDIO_MODULE
|
||||
#define BUILD_USERSCORES_MODULE
|
||||
#define BUILD_LEARN_MODULE
|
||||
#define BUILD_WORKSPACE_MODULE
|
||||
#define BUILD_CLOUD_MODULE
|
||||
#define BUILD_LANGUAGES_MODULE
|
||||
#define BUILD_PLUGINS_MODULE
|
||||
#define BUILD_PLAYBACK_MODULE
|
||||
#define BUILD_PALETTE_MODULE
|
||||
#define BUILD_INSTRUMENTSSCENE_MODULE
|
||||
#define BUILD_INSPECTOR_MODULE
|
||||
#define BUILD_AUTOBOT_MODULE
|
||||
#define BUILD_MULTIINSTANCES_MODULE
|
||||
#define BUILD_VST
|
||||
|
||||
/* #undef ENGRAVING_BUILD_ACCESSIBLE_TREE */
|
||||
|
||||
/* #undef SPARKLE_ENABLED */
|
||||
/* #undef OPENGL */
|
||||
#define SOUNDFONT3
|
||||
/* #undef WIN_PORTABLE */
|
||||
|
||||
/* #undef QML_LOAD_FROM_SOURCE */
|
||||
/* #undef TRACE_DRAW_OBJ_ENABLED */
|
||||
|
||||
/* #undef Q_WS_UIKIT */
|
||||
|
||||
#define APP_UPDATABLE
|
||||
|
||||
#define USE_BSP true
|
||||
|
||||
// does not work on windows/mac:
|
||||
//#define USE_GLYPHS true
|
||||
|
||||
#endif /* MUSESCORE_CONFIG_H */
|
90
tools/check_build_without_qt/fontproviderstub.cpp
Normal file
90
tools/check_build_without_qt/fontproviderstub.cpp
Normal file
|
@ -0,0 +1,90 @@
|
|||
#include "fontproviderstub.h"
|
||||
|
||||
using namespace mu;
|
||||
using namespace mu::draw;
|
||||
|
||||
int FontProviderStub::addApplicationFont(const String&, const String&)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void FontProviderStub::insertSubstitution(const String&, const String&)
|
||||
{
|
||||
}
|
||||
|
||||
qreal FontProviderStub::lineSpacing(const Font&) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
qreal FontProviderStub::xHeight(const Font&) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
qreal FontProviderStub::height(const Font&) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
qreal FontProviderStub::ascent(const Font&) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
qreal FontProviderStub::descent(const Font&) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
bool FontProviderStub::inFont(const Font&, Char) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FontProviderStub::inFontUcs4(const Font&, uint) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Text
|
||||
qreal FontProviderStub::horizontalAdvance(const Font&, const String&) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
qreal FontProviderStub::horizontalAdvance(const Font&, const Char&) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
RectF FontProviderStub::boundingRect(const Font&, const String&) const
|
||||
{
|
||||
return RectF();
|
||||
}
|
||||
|
||||
RectF FontProviderStub::boundingRect(const Font&, const Char&) const
|
||||
{
|
||||
return RectF();
|
||||
}
|
||||
|
||||
RectF FontProviderStub::boundingRect(const Font&, const RectF&, int, const String&) const
|
||||
{
|
||||
return RectF();
|
||||
}
|
||||
|
||||
RectF FontProviderStub::tightBoundingRect(const Font&, const String&) const
|
||||
{
|
||||
return RectF();
|
||||
}
|
||||
|
||||
// Score symbols
|
||||
RectF FontProviderStub::symBBox(const Font&, uint, qreal) const
|
||||
{
|
||||
return RectF();
|
||||
}
|
||||
|
||||
qreal FontProviderStub::symAdvance(const Font&, uint, qreal) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
38
tools/check_build_without_qt/fontproviderstub.h
Normal file
38
tools/check_build_without_qt/fontproviderstub.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
#ifndef FONTPROVIDERSTUB_H
|
||||
#define FONTPROVIDERSTUB_H
|
||||
|
||||
#include "engraving/infrastructure/draw/ifontprovider.h"
|
||||
|
||||
namespace mu::draw {
|
||||
class FontProviderStub : public IFontProvider
|
||||
{
|
||||
public:
|
||||
|
||||
int addApplicationFont(const String& family, const String& path) override;
|
||||
void insertSubstitution(const String& familyName, const String& substituteName) override;
|
||||
|
||||
qreal lineSpacing(const Font& f) const override;
|
||||
qreal xHeight(const Font& f) const override;
|
||||
qreal height(const Font& f) const override;
|
||||
qreal ascent(const Font& f) const override;
|
||||
qreal descent(const Font& f) const override;
|
||||
|
||||
bool inFont(const Font& f, Char ch) const override;
|
||||
bool inFontUcs4(const Font& f, uint ucs4) const override;
|
||||
|
||||
// Text
|
||||
qreal horizontalAdvance(const Font& f, const String& string) const override;
|
||||
qreal horizontalAdvance(const Font& f, const Char& ch) const override;
|
||||
|
||||
RectF boundingRect(const Font& f, const String& string) const override;
|
||||
RectF boundingRect(const Font& f, const Char& ch) const override;
|
||||
RectF boundingRect(const Font& f, const RectF& r, int flags, const String& string) const override;
|
||||
RectF tightBoundingRect(const Font& f, const String& string) const override;
|
||||
|
||||
// Score symbols
|
||||
RectF symBBox(const Font& f, uint ucs4, qreal DPI_F) const override;
|
||||
qreal symAdvance(const Font& f, uint ucs4, qreal DPI_F) const override;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // FONTPROVIDERSTUB_H
|
13
tools/check_build_without_qt/main.cpp
Normal file
13
tools/check_build_without_qt/main.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include "modularity/ioc.h"
|
||||
|
||||
#include "fontproviderstub.h"
|
||||
|
||||
#include "engraving/libmscore/score.h"
|
||||
#include "engraving/compat/scoreaccess.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
mu::modularity::ioc()->registerExport<mu::draw::IFontProvider>("test", new mu::draw::FontProviderStub());
|
||||
|
||||
mu::engraving::MasterScore* s = mu::engraving::compat::ScoreAccess::createMasterScore();
|
||||
}
|
Loading…
Reference in a new issue