Skip to content

Commit 080a636

Browse files
committed
first commit
0 parents  commit 080a636

File tree

9,423 files changed

+3820492
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

9,423 files changed

+3820492
-0
lines changed

.dockerignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Build
2+
Build.bat
3+
/build/
4+
deps/build
5+
MYMETA.json
6+
MYMETA.yml
7+
_build
8+
blib
9+
xs/buildtmp
10+
*.o
11+
*.log
12+
MANIFEST.bak
13+
xs/MANIFEST.bak
14+
xs/assertlib*
15+
.init_bundle.ini
16+
.vs/*
17+
local-lib
18+
/src/TAGS
19+
/.vscode/
20+
build-linux/*
21+
deps/build-linux/*
22+
**/.DS_Store
23+
install_*
24+
build_*/
25+
SVG
26+
Dockerfile
27+
DockerBuild.sh
28+
DockerRun.sh
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Build Windows
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
build_windows:
13+
name: Build Windows
14+
runs-on: windows-latest
15+
env:
16+
dep-cache-path: ${{ github.workspace }}\deps\build\BambuStudio_dep
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
with:
22+
lfs: 'true'
23+
24+
- name: Setup MSVC
25+
uses: microsoft/setup-msbuild@v2
26+
27+
# ---------- deps cache ----------
28+
- name: Check deps cache
29+
id: cache_deps
30+
uses: actions/cache@v5
31+
with:
32+
path: ${{ env.dep-cache-path }}
33+
key: windows-cache-bambustudio_deps-build-${{ hashFiles('deps/**') }}
34+
35+
- name: Install dep build tools
36+
if: steps.cache_deps.outputs.cache-hit != 'true'
37+
run: |
38+
choco install strawberryperl -y
39+
choco install pkgconfiglite -y
40+
41+
- name: Build deps
42+
if: steps.cache_deps.outputs.cache-hit != 'true'
43+
working-directory: ${{ github.workspace }}
44+
run: |
45+
mkdir deps\build
46+
mkdir deps\build\BambuStudio_dep
47+
cd deps\build
48+
cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="./BambuStudio_dep" -DCMAKE_BUILD_TYPE=Release -DDEP_DEBUG=OFF
49+
msbuild /m ALL_BUILD.vcxproj
50+
51+
# ---------- build BambuStudio ----------
52+
- name: Get version and date
53+
run: |
54+
$date = Get-Date -Format 'yyyyMMdd'
55+
$versionContent = Get-Content version.inc -Raw
56+
if ($versionContent -match 'set\(SLIC3R_VERSION "(.*?)"\)') {
57+
$ver = $matches[1]
58+
}
59+
$ver = "V$ver"
60+
echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
61+
echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
62+
shell: pwsh
63+
64+
- name: Install build tools
65+
run: |
66+
choco install nsis -y
67+
choco install pkgconfiglite -y
68+
69+
- name: Build BambuStudio
70+
working-directory: ${{ github.workspace }}
71+
run: |
72+
mkdir build
73+
cd build
74+
cmake .. -G "Visual Studio 17 2022" -A X64 -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0 -DCMAKE_PREFIX_PATH="${{ github.workspace }}\deps\build\BambuStudio_dep\usr\local" -DCMAKE_INSTALL_PREFIX="../install-dir" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0"
75+
cmake --build . --target install --config Release -- -m
76+
77+
# ---------- package & upload ----------
78+
- name: Pack portable zip
79+
working-directory: ${{ github.workspace }}
80+
shell: cmd
81+
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip BambuStudio_Windows_${{ env.ver }}_portable.zip ${{ github.workspace }}\install-dir'
82+
83+
- name: Upload artifact
84+
uses: actions/upload-artifact@v7
85+
with:
86+
name: BambuStudio_Windows_${{ env.ver }}_portable
87+
path: ${{ github.workspace }}/BambuStudio_Windows_${{ env.ver }}_portable.zip

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Build
2+
Build.bat
3+
/build/
4+
/build2022/
5+
deps/build
6+
MYMETA.json
7+
MYMETA.yml
8+
_build
9+
blib
10+
xs/buildtmp
11+
*.o
12+
*.log
13+
MANIFEST.bak
14+
xs/MANIFEST.bak
15+
xs/assertlib*
16+
.init_bundle.ini
17+
.vs/*
18+
local-lib
19+
/src/TAGS
20+
/.vscode/
21+
build-linux/*
22+
deps/build-linux/*
23+
**/.DS_Store
24+
install_*
25+
build_*/
26+
SVG
27+
doc/
28+
**/process_full/
29+
**/machine_full/
30+
**/filament_full/
31+
test.js
32+
/.cache/
33+
.clangd

BambuStudio.mo

244 KB
Binary file not shown.

BambuStudio.sublime-project

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"build_systems":
3+
[
4+
{
5+
"name": "List",
6+
//"file_regex": " at ([^-\\s]*) line ([0-9]*)",
7+
// "file_regex": " at (D\\:\\/src\\/Slic3r\\/.*?) line ([0-9]*)",
8+
"shell_cmd": "ls -l"
9+
},
10+
{
11+
"name": "Run",
12+
"working_dir": "$project_path",
13+
"file_regex": " at (.*?) line ([0-9]*)",
14+
// "shell_cmd": "chdir & perl slic3r.pl --DataDir \"C:\\Users\\Public\\Documents\\Prusa3D\\Slic3r settings MK2\" --gui \"..\\Slic3r-tests\\gap fill torture 20 -rt.stl\""
15+
"shell_cmd": "chdir & perl slic3r.pl"
16+
},
17+
{
18+
"name": "full",
19+
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
20+
"shell_cmd": "chdir & perl Build.pl"
21+
},
22+
{
23+
"name": "xs",
24+
"working_dir": "$project_path/build",
25+
// for Visual Studio:
26+
"file_regex": "^(..[^:]*)\\(([0-9]+)\\)(.*)$",
27+
// For GCC:
28+
// "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
29+
"shell_cmd": "chdir & ninja -j 6 -v",
30+
"env": {
31+
// "PATH": "C:\\Program Files (x86)\\MSBuild\\12.0\\bin\\amd64;C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\BIN\\amd64;C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE;C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools;%PATH%;c:\\wperl64d\\site\\bin;c:\\wperl64d\\bin",
32+
// "PERL_CPANM_HOME": "c:\\wperl64d\\cpanm",
33+
// "WXDIR": "D:\\src-perl\\wxWidgets-3.0.3-beta1",
34+
// "BOOST_DIR": "D:\\src-perl\\boost_1_61_0",
35+
// "BOOST_INCLUDEDIR": "D:\\src-perl\\boost_1_61_0",
36+
// "BOOST_LIBRARYDIR": "D:\\src-perl\\boost_1_61_0\\stage\\x64\\lib",
37+
// "SLIC3R_STATIC": "1"
38+
}
39+
},
40+
{
41+
"name": "xs & run",
42+
"working_dir": "$project_path/build",
43+
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
44+
"shell_cmd": "chdir & ninja -j 6 & cd .. & perl slic3r.pl --gui \"..\\Slic3r-tests\\star3-big2.stl\""
45+
},
46+
{
47+
"name": "Slic3r - clean",
48+
"working_dir": "$project_path/build",
49+
"file_regex": "^(..[^:]*)(?::|\\()([0-9]+)(?::|\\))(?:([0-9]+):)?\\s*(.*)",
50+
"shell_cmd": ["chdir & ninja clean"]
51+
},
52+
{
53+
"name": "run tests",
54+
"working_dir": "$project_path/build",
55+
// for Visual Studio:
56+
"file_regex": "^(..[^:]*)\\(([0-9]+)\\)(.*)$",
57+
"shell_cmd": "chdir & ctest --verbose"
58+
},
59+
{
60+
"name": "Clean & Configure",
61+
"working_dir": "$project_path",
62+
// for Visual Studio:
63+
"file_regex": "^(..[^:]*)(?::|\\()([0-9]+)(?::|\\))(?:([0-9]+):)?\\s*(.*)",
64+
"shell_cmd": "chdir & rmdir /S /Q build & mkdir build & cd build & cmake -G Ninja .. -DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_RULE_PROGRESS=OFF -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo"
65+
},
66+
{
67+
"name": "Configure",
68+
"working_dir": "$project_path/build",
69+
// for Visual Studio:
70+
"file_regex": "^(..[^:]*)(?::|\\()([0-9]+)(?::|\\))(?:([0-9]+):)?\\s*(.*)",
71+
"shell_cmd": "cmake -G Ninja .. -DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_RULE_PROGRESS=OFF -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo"
72+
}
73+
],
74+
"folders":
75+
[
76+
{
77+
"path": ".",
78+
// "folder_exclude_patterns": [".svn", "._d", ".metadata", ".settings"],
79+
"file_exclude_patterns": ["XS.c", "*.pch", "*.ilk", "*.js" ]
80+
}
81+
],
82+
83+
"settings":
84+
{
85+
"sublimegdb_workingdir": "${folder:${project_path:run}}",
86+
// NOTE: You MUST provide --interpreter=mi for the plugin to work
87+
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi -ex 'target localhost:2345'",
88+
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi perl --args perl slic3r.pl",
89+
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi perl --args slic3r.pl ",
90+
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi -e C:\\Strawberry\\perl\\bin\\perl.exe -s C:\\Strawberry\\perl\\site\\lib\\auto\\Slic3r\\XS\\XS.xs.dll --args perl slic3r.pl -j 1 --gui D:\\src\\Slic3r-tests\\star3-big.stl",
91+
"sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi perl.exe --args perl slic3r.pl -j 1 --gui", // D:\\src\\Slic3r-tests\\star3-big.stl",
92+
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi -x slic3r.gdb",
93+
// "arguments": "slic3r -j 1 --gui ../Slic3r-tests/star3-big.stl",
94+
// "arguments": "../slic3r.pl -j 1 --gui",
95+
// "sublimegdb_exec_cmd": "-exec-continue",
96+
97+
// Add "pending breakpoints" for symbols that are dynamically loaded from
98+
// external shared libraries
99+
"debug_ext" : true,
100+
"run_after_init": false,
101+
"close_views": false
102+
}
103+
}

Build.PL

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#!/usr/bin/perl
2+
3+
print "This script is currently used for installing Perl dependencies for running\n";
4+
print "the libslic3r unit / integration tests through Perl prove.\n";
5+
print "If you don't plan to run the unit / integration tests, you don't need to\n";
6+
print "install these dependencies to build and run BambuSlicer.\n";
7+
8+
use strict;
9+
use warnings;
10+
11+
use Config;
12+
use File::Spec;
13+
14+
my %prereqs = qw(
15+
Devel::CheckLib 0
16+
ExtUtils::MakeMaker 6.80
17+
ExtUtils::ParseXS 3.22
18+
ExtUtils::XSpp 0
19+
ExtUtils::XSpp::Cmd 0
20+
ExtUtils::CppGuess 0
21+
ExtUtils::Typemaps 0
22+
ExtUtils::Typemaps::Basic 0
23+
File::Basename 0
24+
File::Spec 0
25+
Getopt::Long 0
26+
Module::Build::WithXSpp 0.14
27+
Moo 1.003001
28+
POSIX 0
29+
Scalar::Util 0
30+
Test::More 0
31+
IO::Scalar 0
32+
Time::HiRes 0
33+
);
34+
my %recommends = qw(
35+
Class::XSAccessor 0
36+
Test::Harness 0
37+
);
38+
39+
my $sudo = grep { $_ eq '--sudo' } @ARGV;
40+
my $nolocal = grep { $_ eq '--nolocal' } @ARGV;
41+
42+
my @missing_prereqs = ();
43+
if ($ENV{SLIC3R_NO_AUTO}) {
44+
foreach my $module (sort keys %prereqs) {
45+
my $version = $prereqs{$module};
46+
next if eval "use $module $version; 1";
47+
push @missing_prereqs, $module if exists $prereqs{$module};
48+
print "Missing prerequisite $module $version\n";
49+
}
50+
foreach my $module (sort keys %recommends) {
51+
my $version = $recommends{$module};
52+
next if eval "use $module $version; 1";
53+
print "Missing optional $module $version\n";
54+
}
55+
} else {
56+
my @try = (
57+
$ENV{CPANM} // (),
58+
File::Spec->catfile($Config{sitebin}, 'cpanm'),
59+
File::Spec->catfile($Config{installscript}, 'cpanm'),
60+
);
61+
62+
my $cpanm;
63+
foreach my $path (@try) {
64+
if (-e $path) { # don't use -x because it fails on Windows
65+
$cpanm = $path;
66+
last;
67+
}
68+
}
69+
if (!$cpanm) {
70+
if ($^O =~ /^(?:darwin|linux)$/ && system(qw(which cpanm)) == 0) {
71+
$cpanm = 'cpanm';
72+
}
73+
}
74+
die <<'EOF'
75+
cpanm was not found. Please install it before running this script.
76+
77+
There are several ways to install cpanm, try one of these:
78+
79+
apt-get install cpanminus
80+
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
81+
cpan App::cpanminus
82+
83+
If it is installed in a non-standard location you can do:
84+
85+
CPANM=/path/to/cpanm perl Build.PL
86+
87+
EOF
88+
if !$cpanm;
89+
my @cpanm_args = ();
90+
push @cpanm_args, "--sudo" if $sudo;
91+
92+
# install local::lib without --local-lib otherwise it's not usable afterwards
93+
if (!eval "use local::lib qw(local-lib); 1") {
94+
my $res = system $cpanm, @cpanm_args, 'local::lib';
95+
warn "Warning: local::lib is required. You might need to run the `cpanm --sudo local::lib` command in order to install it.\n"
96+
if $res != 0;
97+
}
98+
99+
push @cpanm_args, ('--local-lib', 'local-lib') if ! $nolocal;
100+
101+
# make sure our cpanm is updated (old ones don't support the ~ syntax)
102+
system $cpanm, @cpanm_args, 'App::cpanminus';
103+
104+
my %modules = (%prereqs, %recommends);
105+
foreach my $module (sort keys %modules) {
106+
my $version = $modules{$module};
107+
my @cmd = ($cpanm, @cpanm_args);
108+
109+
# temporary workaround for upstream bug in test
110+
push @cmd, '--notest'
111+
if $module =~ /^(?:OpenGL|Test::Harness)$/;
112+
113+
push @cmd, "$module~$version";
114+
115+
my $res = system @cmd;
116+
if ($res != 0) {
117+
if (exists $prereqs{$module}) {
118+
push @missing_prereqs, $module;
119+
} else {
120+
printf "Don't worry, this module is optional.\n";
121+
}
122+
}
123+
}
124+
}
125+
126+
print "\n";
127+
print "In the next step, you need to build the BambuStudio C++ library.\n";
128+
print "1) Create a build directory and change to it\n";
129+
print "2) run cmake .. -DCMAKE_BUILD_TYPE=Release\n";
130+
print "3) run make\n";
131+
print "4) to execute the automatic tests, run ctest --verbose\n";
132+
__END__

0 commit comments

Comments
 (0)