Skip to content

Commit

Permalink
Add MacOS pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
huxingyi committed Feb 19, 2023
1 parent 91104ce commit 1f64f7a
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 8 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,19 @@ jobs:
run: |
cd $env:GITHUB_WORKSPACE/application
qmake -spec win32-msvc
nmake -f Makefile.Release
nmake -f Makefile.Release
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Qt
run: |
HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose qt@5
HOMEBREW_VERBOSE_USING_DOTS=1 brew link qt@5 --force
export PATH="/usr/local/opt/qt@5/bin:$PATH"
- name: Build application
run: |
cd ${GITHUB_WORKSPACE}/application
qmake
alias nproc="sysctl -n hw.logicalcpu"
make -j`nproc`
27 changes: 26 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,29 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: Dust3D-win32-x86_64
path: Dust3D-win32-x86_64/
path: Dust3D-win32-x86_64/
macos-upload:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Qt
run: |
HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose qt@5
HOMEBREW_VERBOSE_USING_DOTS=1 brew link qt@5 --force
export PATH="/usr/local/opt/qt@5/bin:$PATH"
- name: Build application
run: |
cd ${GITHUB_WORKSPACE}/application
qmake
alias nproc="sysctl -n hw.logicalcpu"
make -j`nproc`
- name: Generate DMG
run: |
mv dust3d.app Dust3D.app
macdeployqt Dust3D.app -dmg
- name: Upload DMG
uses: actions/upload-artifact@v3
with:
name: Dust3D.dmg
path: Dust3D.dmg
2 changes: 2 additions & 0 deletions application/application.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ DEFINES += _USE_MATH_DEFINES
CONFIG += object_parallel_to_source
CONFIG += no_batch

CONFIG += c++14

CONFIG(release, debug|release) {
win32 {
QMAKE_CXXFLAGS += /MP
Expand Down
1 change: 1 addition & 0 deletions application/sources/component_preview_images_decorator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define DUST3D_APPLICATION_COMPONENT_PREVIEW_IMAGES_DECORATOR_H_

#include <QImage>
#include <QObject>
#include <dust3d/base/uuid.h>
#include <memory>
#include <unordered_map>
Expand Down
8 changes: 4 additions & 4 deletions application/sources/model_mesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,17 @@ void ModelMesh::setHasAmbientOcclusionInImage(bool hasInImage)
void ModelMesh::exportAsObj(QTextStream* textStream)
{
auto& stream = *textStream;
stream << "# " << APP_NAME << " " << APP_HUMAN_VER << endl;
stream << "# " << APP_HOMEPAGE_URL << endl;
stream << "# " << APP_NAME << " " << APP_HUMAN_VER << "\n";
stream << "# " << APP_HOMEPAGE_URL << "\n";
for (std::vector<dust3d::Vector3>::const_iterator it = vertices().begin(); it != vertices().end(); ++it) {
stream << "v " << QString::number((*it).x()) << " " << QString::number((*it).y()) << " " << QString::number((*it).z()) << endl;
stream << "v " << QString::number((*it).x()) << " " << QString::number((*it).y()) << " " << QString::number((*it).z()) << "\n";
}
for (std::vector<std::vector<size_t>>::const_iterator it = faces().begin(); it != faces().end(); ++it) {
stream << "f";
for (std::vector<size_t>::const_iterator subIt = (*it).begin(); subIt != (*it).end(); ++subIt) {
stream << " " << QString::number((1 + *subIt));
}
stream << endl;
stream << "\n";
}
}

Expand Down
1 change: 1 addition & 0 deletions dust3d/mesh/mesh_combiner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <dust3d/mesh/mesh_combiner.h>
#include <dust3d/mesh/solid_mesh_boolean_operation.h>
#include <dust3d/mesh/triangulate.h>
#include <memory>

namespace dust3d {

Expand Down
1 change: 1 addition & 0 deletions dust3d/mesh/mesh_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <dust3d/mesh/tube_mesh_builder.h>
#include <dust3d/mesh/weld_vertices.h>
#include <functional>
#include <memory>

namespace dust3d {

Expand Down
1 change: 1 addition & 0 deletions dust3d/mesh/mesh_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <dust3d/base/debug.h>
#include <dust3d/mesh/mesh_recombiner.h>
#include <dust3d/mesh/mesh_state.h>
#include <memory>

namespace dust3d {

Expand Down
4 changes: 2 additions & 2 deletions dust3d/mesh/re_triangulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ bool ReTriangulator::buildPolygons()
const auto& polyline = m_polylines[polylineIndex];
int frontEdge = attachPointToTriangleEdge(m_points[polyline.front()]);
int backEdge = attachPointToTriangleEdge(m_points[polyline.back()]);
edgePoints[frontEdge].push_back({ polyline.front(),
edgePoints[frontEdge].push_back(EdgePoint { polyline.front(),
polyline.back(),
polylineIndex,
false,
(m_points[polyline.front()] - m_points[frontEdge]).lengthSquared() });
edgePoints[backEdge].push_back({ polyline.back(),
edgePoints[backEdge].push_back(EdgePoint { polyline.back(),
polyline.front(),
polylineIndex,
true,
Expand Down

0 comments on commit 1f64f7a

Please sign in to comment.