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)
|
||||
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_LINK_FLAGS "-lgcov")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall")
|
||||
|
|
|
@ -36,7 +36,7 @@ void TextEditorView::initialize()
|
|||
saveButton->setBackground(Theme::Sys::Color::Primary);
|
||||
saveButton->setMargin(2);
|
||||
auto onSave = [this](Widget* self){
|
||||
if(this && mController && mTextBox)
|
||||
if(mController && mTextBox)
|
||||
{
|
||||
mController->SetContent(mTextBox->getContent());
|
||||
mController->OnSave();
|
||||
|
@ -48,7 +48,7 @@ void TextEditorView::initialize()
|
|||
clearButton->setLabel("Clear");
|
||||
clearButton->setMargin(2);
|
||||
auto onClear = [this](Widget* self){
|
||||
if(this && mController && mTextBox)
|
||||
if(mController && mTextBox)
|
||||
{
|
||||
mController->OnClear();
|
||||
mTextBox->setContent("");
|
||||
|
@ -60,7 +60,7 @@ void TextEditorView::initialize()
|
|||
loadButton->setLabel("Load");
|
||||
loadButton->setMargin(2);
|
||||
auto onLoad = [this](Widget* self){
|
||||
if(this && mController && mTextBox)
|
||||
if(mController && mTextBox)
|
||||
{
|
||||
mController->OnLoad();
|
||||
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:
|
||||
std::string mLabel;
|
||||
bool mValue{ false };
|
||||
TerminalType mType;
|
||||
Wire* mConnection{ nullptr };
|
||||
};
|
||||
|
|
|
@ -9,8 +9,8 @@ public:
|
|||
using TableData = std::map<std::vector<bool>, std::vector<bool> >;
|
||||
|
||||
TruthTable(std::size_t numInputColumns, std::size_t numOutputColumns)
|
||||
: mNumInputColumns(numInputColumns),
|
||||
mNumOutputColumns(numOutputColumns)
|
||||
//: mNumInputColumns(numInputColumns),
|
||||
// mNumOutputColumns(numOutputColumns)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -25,8 +25,8 @@ public:
|
|||
static const TruthTable::TableData AND_TRUTH_TABLE;
|
||||
|
||||
private:
|
||||
std::size_t mNumInputColumns{ 0 };
|
||||
std::size_t mNumOutputColumns{ 0 };
|
||||
//std::size_t mNumInputColumns{ 0 };
|
||||
//std::size_t mNumOutputColumns{ 0 };
|
||||
|
||||
TableData mTable;
|
||||
};
|
|
@ -49,7 +49,6 @@ private:
|
|||
void dumpNode(RawNode<CountPair>* node, unsigned depth) const;
|
||||
|
||||
bool mUseFixedCode{false};
|
||||
bool mTableIsInitialized{false};
|
||||
|
||||
std::vector<unsigned char> mSymbolMapping;
|
||||
HuffmanCodeLengthTable mLiteralLengthTable;
|
||||
|
|
|
@ -30,7 +30,6 @@ public:
|
|||
KeyValuePairs getKeyValuePairs() const;
|
||||
|
||||
private:
|
||||
unsigned mLineOffset{ 0 };
|
||||
std::string mHeader;
|
||||
std::unordered_map<std::string, std::unique_ptr<TomlTable> > mTables;
|
||||
KeyValuePairs mMap;
|
||||
|
|
|
@ -25,6 +25,5 @@ public:
|
|||
void writeBytes(const std::vector<unsigned char> data) override;
|
||||
|
||||
private:
|
||||
unsigned mBufferSize{0};
|
||||
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
|
||||
{
|
||||
return mBounds;
|
||||
|
|
|
@ -10,6 +10,8 @@ class AbstractGrid
|
|||
public:
|
||||
AbstractGrid(const Bounds& bounds, std::size_t numPointsX, std::size_t numPointsY, std::size_t numPointsZ = 1);
|
||||
|
||||
virtual ~AbstractGrid();
|
||||
|
||||
const Bounds& getBounds() const;
|
||||
|
||||
virtual std::size_t getDataSize() const = 0;
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
this->mData->setItem(getOffset(idx, jdx, kdx), value);
|
||||
}
|
||||
|
||||
std::size_t getDataSize() const
|
||||
std::size_t getDataSize() const override
|
||||
{
|
||||
return this->mData->getLength();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <arpa/inet.h>
|
||||
|
||||
UnixSocketInterface::UnixSocketInterface()
|
||||
: mBufferSize(1024)
|
||||
{
|
||||
mMessageHandler = std::make_unique<HttpMessageHandler>();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ public:
|
|||
|
||||
private:
|
||||
static constexpr unsigned BUFFER_SIZE{1024};
|
||||
std::size_t mBufferSize { 0 };
|
||||
std::unique_ptr<ISocketMessageHandler> mMessageHandler;
|
||||
};
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ public:
|
|||
|
||||
};
|
||||
|
||||
virtual ~IImageWriter() = default;
|
||||
|
||||
virtual void write(const Path& path, Image* image) = 0;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
|
||||
std::string toString(PdfXRefTable* xRefTable) override;
|
||||
|
||||
void updateDictionary();
|
||||
void updateDictionary() override;
|
||||
|
||||
private:
|
||||
std::vector<PdfOutlinePtr> mOutlines;
|
||||
|
|
|
@ -17,7 +17,7 @@ class PdfFont : public PdfObject
|
|||
public:
|
||||
std::string toString(PdfXRefTable* xRefTable) override;
|
||||
|
||||
void updateDictionary();
|
||||
void updateDictionary() override;
|
||||
};
|
||||
|
||||
class PdfPage : public PdfObject
|
||||
|
@ -25,11 +25,11 @@ class PdfPage : public PdfObject
|
|||
public:
|
||||
PdfPage(PdfPageTree* parent);
|
||||
|
||||
unsigned indexObjects(unsigned count);
|
||||
unsigned indexObjects(unsigned count) override;
|
||||
|
||||
std::string toString(PdfXRefTable* xRefTable) override;
|
||||
|
||||
void updateDictionary();
|
||||
void updateDictionary() override;
|
||||
|
||||
private:
|
||||
unsigned mWidth{612};
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
|
||||
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 getEdge1Id () const;
|
||||
|
|
|
@ -11,5 +11,5 @@ public:
|
|||
|
||||
std::unique_ptr<AbstractMesh> copy() const override;
|
||||
|
||||
MeshType getType() const;
|
||||
MeshType getType() const override;
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@ class LineNode : public GeometryNode
|
|||
public:
|
||||
LineNode(const Transform& transform, const std::vector<Point>& points);
|
||||
|
||||
Type getType();
|
||||
Type getType() override;
|
||||
|
||||
private:
|
||||
void createOrUpdateGeometry(SceneInfo* sceneInfo) override;
|
||||
|
|
|
@ -135,6 +135,7 @@ void TextNode::updateLines(FontsManager* fontsManager)
|
|||
}
|
||||
output_lines.push_back(working_line);
|
||||
running_width = 0;
|
||||
(void)running_width;
|
||||
}
|
||||
mTextData.mLines = output_lines;
|
||||
|
||||
|
|
|
@ -42,6 +42,5 @@ private:
|
|||
std::unique_ptr<AbstractGeometricItem> mGeometry;
|
||||
|
||||
bool mGeometryIsDirty{true};
|
||||
bool mColorMapIsDirty{true};
|
||||
bool mShowOutline{false};
|
||||
};
|
||||
|
|
|
@ -120,7 +120,7 @@ void SvgPainter::setStyle(SceneModel* model, SvgShapeElement* element) const
|
|||
|
||||
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 onClick = [this, rawPanel](Widget*){
|
||||
if(this && rawPanel)
|
||||
if(rawPanel)
|
||||
{
|
||||
this->getStack()->showChild(rawPanel);
|
||||
}
|
||||
|
|
|
@ -17,13 +17,10 @@ TopBar::TopBar()
|
|||
fileButton->setMaxWidth(60);
|
||||
|
||||
auto onClick = [this](Widget* self){
|
||||
if(this)
|
||||
{
|
||||
auto menu = std::make_unique<TopBarMenu>();
|
||||
auto window = getTopLevelWindow();
|
||||
window->addPopup(std::move(menu));
|
||||
};
|
||||
};
|
||||
fileButton->setOnClickFunction(onClick);
|
||||
addWidget(std::move(fileButton));
|
||||
}
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
|
||||
TextBox::TextBox()
|
||||
: Widget(),
|
||||
mContent(),
|
||||
mCaps(false)
|
||||
mContent()
|
||||
{
|
||||
mBackground = Theme::Sys::Color::Background;
|
||||
mPadding = {20, 0, 20, 0};
|
||||
|
|
|
@ -32,7 +32,6 @@ private:
|
|||
std::string mContent;
|
||||
std::unique_ptr<TextNode> mTextNode;
|
||||
bool mContentDirty{true};
|
||||
bool mCaps;
|
||||
};
|
||||
|
||||
using TextBoxUPtr = std::unique_ptr<TextBox>;
|
||||
|
|
|
@ -47,4 +47,6 @@ class ITheme
|
|||
{
|
||||
public:
|
||||
virtual Color getColor(Theme::Sys::Color token) const = 0;
|
||||
|
||||
virtual ~ITheme() = default;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue