fix compile

This commit is contained in:
supermerill 2020-11-08 18:46:05 +01:00
parent 5633824f87
commit a9675a3f0b
18 changed files with 59 additions and 184 deletions

View File

@ -1,95 +0,0 @@
name: C/C++ CI macos
on:
release:
types: [published]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: change date in version
run: |
sed "s/+UNKNOWN/_$(date '+%F')/" version.inc > version.date.inc
mv version.date.inc version.inc
- name: mkdir in deps
run: mkdir deps/build
- name: cmake deps
working-directory: ./deps/build
run: cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13"
- name: make deps
working-directory: ./deps/build
run: make
- name: clean deps
working-directory: ./deps/build
run: rm -rf dep_*
- name: mkdir build
run: mkdir build
- name: cmake
working-directory: ./build
run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
- name: make slic3r
working-directory: ./build
run: make slic3r
- name: update Info.plist
working-directory: ./build/src
run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist
- name: create directory and copy into it
working-directory: ./build
run: |
mkdir SuperSlicer
mkdir SuperSlicer/SuperSlicer.app
mkdir SuperSlicer/SuperSlicer.app/Contents
mkdir SuperSlicer/SuperSlicer.app/Contents/_CodeSignature
mkdir SuperSlicer/SuperSlicer.app/Contents/Frameworks
mkdir SuperSlicer/SuperSlicer.app/Contents/MacOS
- name: copy resources
working-directory: ./build
run: |
cp -Rf ../resources SuperSlicer/SuperSlicer.app/Contents/resources
cp SuperSlicer/SuperSlicer.app/Contents/resources/icons/slic3r.icns SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns
cp src/Info.date.plist SuperSlicer/SuperSlicer.app/Contents/Info.plist
echo -n -e 'APPL????\x0a' > PkgInfo
cp PkgInfo SuperSlicer/SuperSlicer.app/Contents/PkgInfo
# echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
- name: copy bin
working-directory: ./build
run: |
cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
tar -zcvf SuperSlicer.tar.gz SuperSlicer
- name: create dmg
working-directory: ./build
run: |
hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "SuperSlicer" temp.dmg
hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
# - name: signing resources (creating CodeResources inside _CodeSignature)
# working-directory: .
# run: codesign -s <identity> resources
# maybe i should just try to do that on a separate pc and copy the file here, more secure as a signing process.
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/SuperSlicer.tar.gz
asset_name: SuperSlicer_${{ github.event.release.tag_name }}_macos_${{steps.date.outputs.date}}.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/nightly_macos.dmg
asset_name: SuperSlicer_${{ github.event.release.tag_name }}_macos_${{steps.date.outputs.date}}.dmg
asset_content_type: application/x-apple-diskimage

View File

@ -21,7 +21,7 @@ jobs:
- name: update apt - name: update apt
run: sudo apt update run: sudo apt update
- name: install gtk2 glew - name: install gtk2 glew
run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev
- name: mkdir in deps - name: mkdir in deps
run: mkdir deps/build run: mkdir deps/build
- name: cmake deps - name: cmake deps

View File

@ -1,70 +0,0 @@
name: C/C++ CI ubuntu
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: update clock
run: sudo hwclock -s
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: change date in version
run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
- name: update apt
run: sudo apt update
- name: install gtk2 glew
run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev
- name: mkdir in deps
run: mkdir deps/build
- name: cmake deps
working-directory: ./deps/build
run: cmake ..
- name: make deps
working-directory: ./deps/build
run: make
- name: clean deps
working-directory: ./deps/build
run: rm -rf dep_*
- name: mkdir build
run: mkdir build
- name: cmake
working-directory: ./build
run: cmake .. -DCMAKE_PREFIX_PATH="/home/runner/work/Slic3r/Slic3r/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- name: make slic3r
working-directory: ./build
run: make slic3r
- name: create directory and copy into it
working-directory: ./build
run: |
mkdir package
mkdir package/bin
- name: copy resources
working-directory: ./build
run: cp -Rf ../resources package/resources
- name: copy bin
working-directory: ./build
run: cp -f src/superslicer package/bin/superslicer
- name: create sh from echo
working-directory: ./build/package
run: |
echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/superslicer" "$@"' >SuperSlicer
chmod u+x superslicer
tar -zcvf ../SuperSlicer.tar.gz .
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/SuperSlicer.tar.gz
asset_name: SuperSlicer_${{ github.event.release.tag_name }}_ubu64_${{steps.date.outputs.date}}.tar.gz
asset_content_type: application/gzip

View File

@ -433,10 +433,10 @@ add_custom_target(gettext_po_to_mo
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate localization po files (binary) from mo files (texts)" COMMENT "Generate localization po files (binary) from mo files (texts)"
) )
file(GLOB L10N_PO_FILES "${L10N_DIR}/*/PrusaSlicer*.po") file(GLOB L10N_PO_FILES "${L10N_DIR}/*/SuperSlicer*.po")
foreach(po_file ${L10N_PO_FILES}) foreach(po_file ${L10N_PO_FILES})
GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY) GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY)
SET(mo_file "${po_dir}/PrusaSlicer.mo") SET(mo_file "${po_dir}/SuperSlicer.mo")
add_custom_command( add_custom_command(
TARGET gettext_po_to_mo PRE_BUILD TARGET gettext_po_to_mo PRE_BUILD
COMMAND msgfmt ARGS -o ${mo_file} ${po_file} COMMAND msgfmt ARGS -o ${mo_file} ${po_file}

View File

@ -17,6 +17,16 @@ where `N` is the number of CPU cores available.
Additional CMake flags may be applicable as explained below. Additional CMake flags may be applicable as explained below.
### How to build
You can follow the [script](https://github.com/supermerill/SuperSlicer/blob/master/.github/workflows/ccpp_ubuntu.yml) the build server use to create the ubuntu release.
You have to execute each command at the right of the 'run: ' tags, in the directory that is at the right of the previous 'working-directory:' tag.
You can stop after the `make slic3r` as the rest of the commands are for building the launch script and the appimage.
# Old doc, not up-to-date:
### Dependency resolution ### Dependency resolution
By default SuperSlicer looks for dependencies the default way CMake looks for them, i.e. in default system locations. By default SuperSlicer looks for dependencies the default way CMake looks for them, i.e. in default system locations.

View File

@ -11,6 +11,17 @@ To build SuperSlicer on Mac OS, you will need the following software:
XCode is available through Apple's App Store, the other three tools are available on XCode is available through Apple's App Store, the other three tools are available on
[brew](https://brew.sh/) (use `brew install cmake git gettext` to install them). [brew](https://brew.sh/) (use `brew install cmake git gettext` to install them).
### How to build
You can follow the [script](https://github.com/supermerill/SuperSlicer/blob/master/.github/workflows/ccpp_mac.yml) the build server use to create the ubuntu release.
You have to execute each command at the right of the 'run: ' tags, in the directory that is at the right of the previous 'working-directory:' tag.
You can stop after the `make slic3r` as the rest of the commands are for building the .dmg
# Old doc, not up-to-date:
### Dependencies ### Dependencies
SuperSlicer comes with a set of CMake scripts to build its dependencies, it lives in the `deps` directory. SuperSlicer comes with a set of CMake scripts to build its dependencies, it lives in the `deps` directory.

View File

@ -1,12 +1,30 @@
# Building SuperSlicer on Microsoft Windows # Building SuperSlicer on Microsoft Windows
The currently supported way of building SuperSlicer on Windows is with CMake and MS Visual Studio 2017. The currently supported way of building SuperSlicer on Windows is with CMake and [MS Visual Studio 2019](https://visualstudio.microsoft.com/fr/vs).
You can use the free [Visual Studio 2017 Community Edition](https://www.visualstudio.com/vs/older-downloads/).
CMake installer can be downloaded from [the official website](https://cmake.org/download/).~~ CMake installer can be downloaded from [the official website](https://cmake.org/download/).~~
Building with newer versions of MSVS (2019) should work too. Building with [Visual Studio 2017 Community Edition](https://www.visualstudio.com/vs/older-downloads/). should work too.
### How to build
You have to build the dependancies (in ./deps/build)
```
cmake .. -G "Visual Studio 16 2019" -A x64
msbuild /m ALL_BUILD.vcxproj
```
and then build superslicer (in ./build):
```
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="PATH_TO_SuperSlicer\deps\destdir\usr\local"
msbuild /m /P:Configuration=Release INSTALL.vcxproj
```
You can also build it in visual studio, for that open the .sln.
Note that you need to have `libgmp-10.dll` and `libmpfr-4.dll` next to your built superslicer. You can get them from any superslicer release.
If you want to create the zipped release, you can follow this [script](https://github.com/supermerill/SuperSlicer/blob/master/.github/workflows/ccpp_win.yml).
# Old doc, not up-to-date:
### Building the dependencies package yourself ### Building the dependencies package yourself

View File

@ -91,7 +91,7 @@ endif()
# Create a slic3r executable # Create a slic3r executable
# Process mainfests for various platforms. # Process mainfests for various platforms.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer.rc.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/SuperSlicer.rc.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer-gcodeviewer.rc.in ${CMAKE_CURRENT_BINARY_DIR}/PrusaSlicer-gcodeviewer.rc @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer-gcodeviewer.rc.in ${CMAKE_CURRENT_BINARY_DIR}/PrusaSlicer-gcodeviewer.rc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.manifest @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.manifest @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY)

View File

@ -23,7 +23,6 @@ namespace Slic3r {
class ExPolygon; class ExPolygon;
class Surface; class Surface;
enum InfillPattern : int;
namespace FillAdaptive { namespace FillAdaptive {
struct Octree; struct Octree;

View File

@ -92,7 +92,7 @@ int16_t get_fan_speed(const std::string &line, GCodeFlavor flavor) {
} }
void FanMover::_put_in_middle_G1(std::list<BufferData>::iterator &item_to_split, float nb_sec, BufferData &&line_to_write) { void FanMover::_put_in_middle_G1(std::list<BufferData>::iterator item_to_split, float nb_sec, BufferData &&line_to_write) {
//std::cout << "_put_in_middle_G1\n"; //std::cout << "_put_in_middle_G1\n";
assert(item_to_split != m_buffer.end()); assert(item_to_split != m_buffer.end());
if (nb_sec < item_to_split->time * 0.1) { if (nb_sec < item_to_split->time * 0.1) {

View File

@ -73,13 +73,13 @@ private:
m_buffer.emplace_back(data); m_buffer.emplace_back(data);
return m_buffer.back(); return m_buffer.back();
} }
std::list<BufferData>::iterator remove_from_buffer(std::list<BufferData>::iterator& data) { std::list<BufferData>::iterator remove_from_buffer(std::list<BufferData>::iterator data) {
m_buffer_time_size -= data->time; m_buffer_time_size -= data->time;
return m_buffer.erase(data); return m_buffer.erase(data);
} }
// Processes the given gcode line // Processes the given gcode line
void _process_gcode_line(GCodeReader& reader, const GCodeReader::GCodeLine& line); void _process_gcode_line(GCodeReader& reader, const GCodeReader::GCodeLine& line);
void _put_in_middle_G1(std::list<BufferData>::iterator& item_to_split, float nb_sec, BufferData&& line_to_write); void _put_in_middle_G1(std::list<BufferData>::iterator item_to_split, float nb_sec, BufferData&& line_to_write);
void _print_in_middle_G1(BufferData& line_to_split, float nb_sec, const std::string& line_to_write); void _print_in_middle_G1(BufferData& line_to_split, float nb_sec, const std::string& line_to_write);
void _remove_slow_fan(int16_t min_speed, float past_sec); void _remove_slow_fan(int16_t min_speed, float past_sec);
}; };

View File

@ -479,11 +479,13 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename)
in.close(); in.close();
std::error_code err_code; std::error_code err_code;
if (err_code = rename_file(out_path, filename)) if (err_code = rename_file(out_path, filename)) {
if(copy_file(out_path, filename, (std::string("Failed to rename the output G-code file from ") + out_path + " to " + filename + '\n' + std::string err_msg = (std::string("Failed to rename the output G-code file from ") + out_path + " to " + filename + '\n' +
"Is " + out_path + " locked? (gcp)" + err_code.message() + '\n'), true) != SUCCESS) "Is " + out_path + " locked? (gcp)" + err_code.message() + '\n');
if (copy_file(out_path, filename, err_msg, true) != SUCCESS)
throw Slic3r::RuntimeError(std::string("Failed to rename the output G-code file from ") + out_path + " to " + filename + '\n' + throw Slic3r::RuntimeError(std::string("Failed to rename the output G-code file from ") + out_path + " to " + filename + '\n' +
"Is " + out_path + " locked? (gcp)" + err_code.message() + '\n'); "Is " + out_path + " locked? (gcp)" + err_code.message() + '\n');
}
} }
const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> GCodeProcessor::Producers = { const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> GCodeProcessor::Producers = {

View File

@ -78,7 +78,7 @@ enum AuthorizationType {
atKeyPassword, atUserPassword atKeyPassword, atUserPassword
}; };
enum InfillPattern { enum InfillPattern : uint8_t{
ipRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb, ipRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral,
ipAdaptiveCubic, ipSupportCubic, ipAdaptiveCubic, ipSupportCubic,

View File

@ -22,4 +22,4 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@
} }
} }
2 ICON "@SLIC3R_RESOURCES_DIR@/icons/PrusaSlicer-gcodeviewer.ico" 2 ICON "@SLIC3R_RESOURCES_DIR@/icons/PrusaSlicer-gcodeviewer.ico"
1 24 "PrusaSlicer.manifest" 1 24 "slic3r.manifest"

View File

@ -175,7 +175,7 @@ void init_print(std::vector<TriangleMesh> &&meshes, Slic3r::Print &print, Slic3r
} }
print.apply(model, config); print.apply(model, config);
model.arrange_objects(model, InfiniteBed{}, ArrangeParams{ scaled(min_object_distance(config))}); arrange_objects(&print, model, InfiniteBed{}, ArrangeParams{ scaled(print.config().min_object_distance()) });
print.apply(model, config); print.apply(model, config);
print.validate(); print.validate();
print.set_status_silent(); print.set_status_silent();

View File

@ -43,7 +43,7 @@ SCENARIO("Model construction", "[Model]") {
} }
model_object->add_instance(); model_object->add_instance();
print.apply(model, config); // apply config for arrange_objects print.apply(model, config); // apply config for arrange_objects
arrange_objects(print, model, InfiniteBed{scaled(Vec2d(100, 100))}, ArrangeParams{scaled(min_object_distance(config))}); arrange_objects(&print, model, InfiniteBed{ scaled(Vec2d(100, 100)) }, ArrangeParams{ scaled(print.config().min_object_distance()) });
model_object->ensure_on_bed(); model_object->ensure_on_bed();
print.auto_assign_extruders(model_object); print.auto_assign_extruders(model_object);
THEN("Print works?") { THEN("Print works?") {

View File

@ -21,7 +21,7 @@ using boost::polygon::voronoi_diagram;
using namespace Slic3r; using namespace Slic3r;
using VD = Geometry::VoronoiDiagram; using VD = Slic3r::VoronoiDiagram;
// https://svn.boost.org/trac10/ticket/12067 // https://svn.boost.org/trac10/ticket/12067
// This bug seems to be confirmed. // This bug seems to be confirmed.