Add clang support.
This commit is contained in:
parent
3fad113178
commit
e559f9674d
27 changed files with 84 additions and 63 deletions
|
@ -16,7 +16,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
|
||||||
elseif(CMAKE_COMPILER_IS_GNUCC)
|
#elseif(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
else()
|
||||||
#set(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
|
#set(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
|
||||||
#set(GCC_COVERAGE_LINK_FLAGS "-lgcov")
|
#set(GCC_COVERAGE_LINK_FLAGS "-lgcov")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall")
|
||||||
|
|
|
@ -36,7 +36,7 @@ void TextEditorView::initialize()
|
||||||
saveButton->setBackground(Theme::Sys::Color::Primary);
|
saveButton->setBackground(Theme::Sys::Color::Primary);
|
||||||
saveButton->setMargin(2);
|
saveButton->setMargin(2);
|
||||||
auto onSave = [this](Widget* self){
|
auto onSave = [this](Widget* self){
|
||||||
if(this && mController && mTextBox)
|
if(mController && mTextBox)
|
||||||
{
|
{
|
||||||
mController->SetContent(mTextBox->getContent());
|
mController->SetContent(mTextBox->getContent());
|
||||||
mController->OnSave();
|
mController->OnSave();
|
||||||
|
@ -48,7 +48,7 @@ void TextEditorView::initialize()
|
||||||
clearButton->setLabel("Clear");
|
clearButton->setLabel("Clear");
|
||||||
clearButton->setMargin(2);
|
clearButton->setMargin(2);
|
||||||
auto onClear = [this](Widget* self){
|
auto onClear = [this](Widget* self){
|
||||||
if(this && mController && mTextBox)
|
if(mController && mTextBox)
|
||||||
{
|
{
|
||||||
mController->OnClear();
|
mController->OnClear();
|
||||||
mTextBox->setContent("");
|
mTextBox->setContent("");
|
||||||
|
@ -60,7 +60,7 @@ void TextEditorView::initialize()
|
||||||
loadButton->setLabel("Load");
|
loadButton->setLabel("Load");
|
||||||
loadButton->setMargin(2);
|
loadButton->setMargin(2);
|
||||||
auto onLoad = [this](Widget* self){
|
auto onLoad = [this](Widget* self){
|
||||||
if(this && mController && mTextBox)
|
if(mController && mTextBox)
|
||||||
{
|
{
|
||||||
mController->OnLoad();
|
mController->OnLoad();
|
||||||
mTextBox->setContent(mController->GetContent());
|
mTextBox->setContent(mController->GetContent());
|
||||||
|
|
20
infra/build_configs/README.md
Normal file
20
infra/build_configs/README.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# Compiler Support
|
||||||
|
|
||||||
|
## Linux
|
||||||
|
|
||||||
|
### GCC
|
||||||
|
gcc 11.3.0
|
||||||
|
|
||||||
|
### clang
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt-get install clang
|
||||||
|
mkdir build_clang
|
||||||
|
cd build_clang
|
||||||
|
export CC=/usr/bin/clang
|
||||||
|
export CXX=/usr/bin/clang++
|
||||||
|
cmake $PATH_TO_SOURCE
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
Version 14.0
|
|
@ -28,7 +28,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mLabel;
|
std::string mLabel;
|
||||||
bool mValue{ false };
|
|
||||||
TerminalType mType;
|
TerminalType mType;
|
||||||
Wire* mConnection{ nullptr };
|
Wire* mConnection{ nullptr };
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,8 +9,8 @@ public:
|
||||||
using TableData = std::map<std::vector<bool>, std::vector<bool> >;
|
using TableData = std::map<std::vector<bool>, std::vector<bool> >;
|
||||||
|
|
||||||
TruthTable(std::size_t numInputColumns, std::size_t numOutputColumns)
|
TruthTable(std::size_t numInputColumns, std::size_t numOutputColumns)
|
||||||
: mNumInputColumns(numInputColumns),
|
//: mNumInputColumns(numInputColumns),
|
||||||
mNumOutputColumns(numOutputColumns)
|
// mNumOutputColumns(numOutputColumns)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ public:
|
||||||
static const TruthTable::TableData AND_TRUTH_TABLE;
|
static const TruthTable::TableData AND_TRUTH_TABLE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::size_t mNumInputColumns{ 0 };
|
//std::size_t mNumInputColumns{ 0 };
|
||||||
std::size_t mNumOutputColumns{ 0 };
|
//std::size_t mNumOutputColumns{ 0 };
|
||||||
|
|
||||||
TableData mTable;
|
TableData mTable;
|
||||||
};
|
};
|
|
@ -49,7 +49,6 @@ private:
|
||||||
void dumpNode(RawNode<CountPair>* node, unsigned depth) const;
|
void dumpNode(RawNode<CountPair>* node, unsigned depth) const;
|
||||||
|
|
||||||
bool mUseFixedCode{false};
|
bool mUseFixedCode{false};
|
||||||
bool mTableIsInitialized{false};
|
|
||||||
|
|
||||||
std::vector<unsigned char> mSymbolMapping;
|
std::vector<unsigned char> mSymbolMapping;
|
||||||
HuffmanCodeLengthTable mLiteralLengthTable;
|
HuffmanCodeLengthTable mLiteralLengthTable;
|
||||||
|
|
|
@ -30,7 +30,6 @@ public:
|
||||||
KeyValuePairs getKeyValuePairs() const;
|
KeyValuePairs getKeyValuePairs() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned mLineOffset{ 0 };
|
|
||||||
std::string mHeader;
|
std::string mHeader;
|
||||||
std::unordered_map<std::string, std::unique_ptr<TomlTable> > mTables;
|
std::unordered_map<std::string, std::unique_ptr<TomlTable> > mTables;
|
||||||
KeyValuePairs mMap;
|
KeyValuePairs mMap;
|
||||||
|
|
|
@ -25,6 +25,5 @@ public:
|
||||||
void writeBytes(const std::vector<unsigned char> data) override;
|
void writeBytes(const std::vector<unsigned char> data) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned mBufferSize{0};
|
|
||||||
std::vector<unsigned char> mBuffer;
|
std::vector<unsigned char> mBuffer;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,6 +9,11 @@ AbstractGrid::AbstractGrid(const Bounds& bounds, std::size_t numPointsX, std::si
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AbstractGrid::~AbstractGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const Bounds& AbstractGrid::getBounds() const
|
const Bounds& AbstractGrid::getBounds() const
|
||||||
{
|
{
|
||||||
return mBounds;
|
return mBounds;
|
||||||
|
|
|
@ -10,6 +10,8 @@ class AbstractGrid
|
||||||
public:
|
public:
|
||||||
AbstractGrid(const Bounds& bounds, std::size_t numPointsX, std::size_t numPointsY, std::size_t numPointsZ = 1);
|
AbstractGrid(const Bounds& bounds, std::size_t numPointsX, std::size_t numPointsY, std::size_t numPointsZ = 1);
|
||||||
|
|
||||||
|
virtual ~AbstractGrid();
|
||||||
|
|
||||||
const Bounds& getBounds() const;
|
const Bounds& getBounds() const;
|
||||||
|
|
||||||
virtual std::size_t getDataSize() const = 0;
|
virtual std::size_t getDataSize() const = 0;
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
this->mData->setItem(getOffset(idx, jdx, kdx), value);
|
this->mData->setItem(getOffset(idx, jdx, kdx), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t getDataSize() const
|
std::size_t getDataSize() const override
|
||||||
{
|
{
|
||||||
return this->mData->getLength();
|
return this->mData->getLength();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
UnixSocketInterface::UnixSocketInterface()
|
UnixSocketInterface::UnixSocketInterface()
|
||||||
: mBufferSize(1024)
|
|
||||||
{
|
{
|
||||||
mMessageHandler = std::make_unique<HttpMessageHandler>();
|
mMessageHandler = std::make_unique<HttpMessageHandler>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr unsigned BUFFER_SIZE{1024};
|
static constexpr unsigned BUFFER_SIZE{1024};
|
||||||
std::size_t mBufferSize { 0 };
|
|
||||||
std::unique_ptr<ISocketMessageHandler> mMessageHandler;
|
std::unique_ptr<ISocketMessageHandler> mMessageHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual ~IImageWriter() = default;
|
||||||
|
|
||||||
virtual void write(const Path& path, Image* image) = 0;
|
virtual void write(const Path& path, Image* image) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -19,7 +19,7 @@ public:
|
||||||
|
|
||||||
std::string toString(PdfXRefTable* xRefTable) override;
|
std::string toString(PdfXRefTable* xRefTable) override;
|
||||||
|
|
||||||
void updateDictionary();
|
void updateDictionary() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<PdfOutlinePtr> mOutlines;
|
std::vector<PdfOutlinePtr> mOutlines;
|
||||||
|
|
|
@ -17,7 +17,7 @@ class PdfFont : public PdfObject
|
||||||
public:
|
public:
|
||||||
std::string toString(PdfXRefTable* xRefTable) override;
|
std::string toString(PdfXRefTable* xRefTable) override;
|
||||||
|
|
||||||
void updateDictionary();
|
void updateDictionary() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PdfPage : public PdfObject
|
class PdfPage : public PdfObject
|
||||||
|
@ -25,11 +25,11 @@ class PdfPage : public PdfObject
|
||||||
public:
|
public:
|
||||||
PdfPage(PdfPageTree* parent);
|
PdfPage(PdfPageTree* parent);
|
||||||
|
|
||||||
unsigned indexObjects(unsigned count);
|
unsigned indexObjects(unsigned count) override;
|
||||||
|
|
||||||
std::string toString(PdfXRefTable* xRefTable) override;
|
std::string toString(PdfXRefTable* xRefTable) override;
|
||||||
|
|
||||||
void updateDictionary();
|
void updateDictionary() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned mWidth{612};
|
unsigned mWidth{612};
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
|
|
||||||
std::size_t getNumNodes() const override;
|
std::size_t getNumNodes() const override;
|
||||||
|
|
||||||
void replaceEdge(Edge* original, Edge* replacement);
|
void replaceEdge(Edge* original, Edge* replacement) override;
|
||||||
|
|
||||||
std::size_t getEdge0Id () const;
|
std::size_t getEdge0Id () const;
|
||||||
std::size_t getEdge1Id () const;
|
std::size_t getEdge1Id () const;
|
||||||
|
|
|
@ -11,5 +11,5 @@ public:
|
||||||
|
|
||||||
std::unique_ptr<AbstractMesh> copy() const override;
|
std::unique_ptr<AbstractMesh> copy() const override;
|
||||||
|
|
||||||
MeshType getType() const;
|
MeshType getType() const override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,7 @@ class LineNode : public GeometryNode
|
||||||
public:
|
public:
|
||||||
LineNode(const Transform& transform, const std::vector<Point>& points);
|
LineNode(const Transform& transform, const std::vector<Point>& points);
|
||||||
|
|
||||||
Type getType();
|
Type getType() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createOrUpdateGeometry(SceneInfo* sceneInfo) override;
|
void createOrUpdateGeometry(SceneInfo* sceneInfo) override;
|
||||||
|
|
|
@ -135,6 +135,7 @@ void TextNode::updateLines(FontsManager* fontsManager)
|
||||||
}
|
}
|
||||||
output_lines.push_back(working_line);
|
output_lines.push_back(working_line);
|
||||||
running_width = 0;
|
running_width = 0;
|
||||||
|
(void)running_width;
|
||||||
}
|
}
|
||||||
mTextData.mLines = output_lines;
|
mTextData.mLines = output_lines;
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,5 @@ private:
|
||||||
std::unique_ptr<AbstractGeometricItem> mGeometry;
|
std::unique_ptr<AbstractGeometricItem> mGeometry;
|
||||||
|
|
||||||
bool mGeometryIsDirty{true};
|
bool mGeometryIsDirty{true};
|
||||||
bool mColorMapIsDirty{true};
|
|
||||||
bool mShowOutline{false};
|
bool mShowOutline{false};
|
||||||
};
|
};
|
||||||
|
|
|
@ -120,7 +120,7 @@ void SvgPainter::setStyle(SceneModel* model, SvgShapeElement* element) const
|
||||||
|
|
||||||
if (!transform.isDefaultTransform())
|
if (!transform.isDefaultTransform())
|
||||||
{
|
{
|
||||||
element->addAttribute(std::move(toTransform(transform)));
|
element->addAttribute(toTransform(transform));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ void TabbedPanelWidget::addPanel(WidgetUPtr panel, const std::string& label)
|
||||||
|
|
||||||
auto rawPanel = panel.get();
|
auto rawPanel = panel.get();
|
||||||
auto onClick = [this, rawPanel](Widget*){
|
auto onClick = [this, rawPanel](Widget*){
|
||||||
if(this && rawPanel)
|
if(rawPanel)
|
||||||
{
|
{
|
||||||
this->getStack()->showChild(rawPanel);
|
this->getStack()->showChild(rawPanel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,13 +17,10 @@ TopBar::TopBar()
|
||||||
fileButton->setMaxWidth(60);
|
fileButton->setMaxWidth(60);
|
||||||
|
|
||||||
auto onClick = [this](Widget* self){
|
auto onClick = [this](Widget* self){
|
||||||
if(this)
|
|
||||||
{
|
|
||||||
auto menu = std::make_unique<TopBarMenu>();
|
auto menu = std::make_unique<TopBarMenu>();
|
||||||
auto window = getTopLevelWindow();
|
auto window = getTopLevelWindow();
|
||||||
window->addPopup(std::move(menu));
|
window->addPopup(std::move(menu));
|
||||||
};
|
};
|
||||||
};
|
|
||||||
fileButton->setOnClickFunction(onClick);
|
fileButton->setOnClickFunction(onClick);
|
||||||
addWidget(std::move(fileButton));
|
addWidget(std::move(fileButton));
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
|
|
||||||
TextBox::TextBox()
|
TextBox::TextBox()
|
||||||
: Widget(),
|
: Widget(),
|
||||||
mContent(),
|
mContent()
|
||||||
mCaps(false)
|
|
||||||
{
|
{
|
||||||
mBackground = Theme::Sys::Color::Background;
|
mBackground = Theme::Sys::Color::Background;
|
||||||
mPadding = {20, 0, 20, 0};
|
mPadding = {20, 0, 20, 0};
|
||||||
|
|
|
@ -32,7 +32,6 @@ private:
|
||||||
std::string mContent;
|
std::string mContent;
|
||||||
std::unique_ptr<TextNode> mTextNode;
|
std::unique_ptr<TextNode> mTextNode;
|
||||||
bool mContentDirty{true};
|
bool mContentDirty{true};
|
||||||
bool mCaps;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using TextBoxUPtr = std::unique_ptr<TextBox>;
|
using TextBoxUPtr = std::unique_ptr<TextBox>;
|
||||||
|
|
|
@ -47,4 +47,6 @@ class ITheme
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual Color getColor(Theme::Sys::Color token) const = 0;
|
virtual Color getColor(Theme::Sys::Color token) const = 0;
|
||||||
|
|
||||||
|
virtual ~ITheme() = default;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue