Compare commits
15 Commits
v2.3.0-bet
...
v1.0.10-sf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a60ca28b4 | ||
|
|
2b59b6e974 | ||
|
|
8f594471c0 | ||
|
|
0977e3077f | ||
|
|
f087cd0db9 | ||
|
|
5e615feef5 | ||
|
|
5f1725246f | ||
|
|
829fc90e6f | ||
|
|
cc94674e39 | ||
|
|
f16521adf6 | ||
|
|
fc9d18faff | ||
|
|
ff768a6f68 | ||
|
|
9c0f6f1c72 | ||
|
|
7a7369c9ce | ||
|
|
687593f8d2 |
120
.clang-format
@@ -1,120 +0,0 @@
|
||||
#
|
||||
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
#
|
||||
Language: Cpp
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveDeclarations: true
|
||||
AlignEscapedNewlines: DontAlign
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: true
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: false
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 140
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: true
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- forever
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^<Q.*'
|
||||
Priority: 200
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IndentCaseLabels: false
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
#KeepLineBreaksForNonEmptyLines: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 4
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 150
|
||||
PenaltyBreakBeforeFirstCallParameter: 300
|
||||
PenaltyBreakComment: 500
|
||||
PenaltyBreakFirstLessLess: 400
|
||||
PenaltyBreakString: 600
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 50
|
||||
PenaltyReturnTypeOnItsOwnLine: 300
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: false
|
||||
SortUsingDeclarations: false
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE}
|
||||
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"name": "OrcaSlicer",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"PLATFORM": "linux/amd64",
|
||||
"BASE_IMAGE": "mcr.microsoft.com/devcontainers/cpp:ubuntu-20.04"
|
||||
},
|
||||
"options": ["--platform=linux/amd64"]
|
||||
},
|
||||
"runArgs": ["--env-file", "/tmp/devcontainer.env"],
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/desktop-lite:1": {
|
||||
"password": "orca"
|
||||
}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {
|
||||
"cmake.configureArgs": [
|
||||
"-DSLIC3R_GTK=3",
|
||||
"-DBBL_RELEASE_TO_PUBLIC=1",
|
||||
"-DBBL_INTERNAL_TESTING=0",
|
||||
"-DSLIC3R_STATIC=1",
|
||||
"-DCMAKE_PREFIX_PATH=${workspaceFolder}/deps/build/destdir/usr/local"
|
||||
],
|
||||
"cmake.buildToolArgs": [
|
||||
"-l${containerEnv:CORES}"
|
||||
]
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-vscode.cmake-tools",
|
||||
"ms-vscode.cpptools-extension-pack"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"forwardPorts": [6080],
|
||||
"portsAttributes": {
|
||||
"6080": {
|
||||
"label": "VNC web client (noVNC)",
|
||||
"onAutoForward": "silent"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
},
|
||||
|
||||
"initializeCommand": {
|
||||
"Setup Temporary Env File": "echo \"CORES=`nproc --all`\" > /tmp/devcontainer.env"
|
||||
},
|
||||
"onCreateCommand": {
|
||||
"Set postCreate executable flag": "chmod +x .devcontainer/postCreate.sh"
|
||||
},
|
||||
"postCreateCommand": "sudo .devcontainer/postCreate.sh"
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Update and upgrade all system packages
|
||||
apt update
|
||||
apt upgrade -y
|
||||
|
||||
echo "-----------------------------------------"
|
||||
echo "Running BuildLinux.sh with update flag..."
|
||||
echo "-----------------------------------------"
|
||||
./BuildLinux.sh -u
|
||||
|
||||
echo "------------------------------"
|
||||
echo "Installing missing packages..."
|
||||
echo "------------------------------"
|
||||
apt install -y libgl1-mesa-dev m4 autoconf libtool
|
||||
@@ -1,28 +0,0 @@
|
||||
Build
|
||||
Build.bat
|
||||
/build/
|
||||
deps/build
|
||||
MYMETA.json
|
||||
MYMETA.yml
|
||||
_build
|
||||
blib
|
||||
xs/buildtmp
|
||||
*.o
|
||||
*.log
|
||||
MANIFEST.bak
|
||||
xs/MANIFEST.bak
|
||||
xs/assertlib*
|
||||
.init_bundle.ini
|
||||
.vs/*
|
||||
local-lib
|
||||
/src/TAGS
|
||||
/.vscode/
|
||||
build-linux/*
|
||||
deps/build-linux/*
|
||||
**/.DS_Store
|
||||
install_*
|
||||
build_*/
|
||||
SVG
|
||||
Dockerfile
|
||||
DockerBuild.sh
|
||||
DockerRun.sh
|
||||
0
.gitattributes
vendored
3
.github/FUNDING.yml
vendored
@@ -1,3 +0,0 @@
|
||||
github: SoftFever
|
||||
ko_fi: SoftFever
|
||||
custom: https://paypal.me/softfever3d
|
||||
133
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,133 +0,0 @@
|
||||
name: 🐞 Bug Report
|
||||
description: File a bug report
|
||||
labels: ["bug"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Thank you for using Orca Slicer and wanting to report a bug.**
|
||||
|
||||
Please note that this is not the place to make feature requests or ask for help.
|
||||
For this, please use the [Feature request](https://github.com/SoftFever/OrcaSlicer/issues/new?assignees=&labels=&projects=&template=feature_request.yml) issue type or you can discuss your idea on our [Discord server](https://discord.gg/P4VE9UY9gJ) with others.
|
||||
|
||||
Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this problem?
|
||||
description: Please search to see if an issue already exists for the bug you encountered.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: OrcaSlicer Version
|
||||
description: Which version of Orca Slicer are you running? You can see the full version in `Help` -> `About Orca Slicer`.
|
||||
placeholder: e.g. 1.9.0
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: os_type
|
||||
attributes:
|
||||
label: "Operating System (OS)"
|
||||
description: "What OSes are you are experiencing issues on?"
|
||||
multiple: true
|
||||
options:
|
||||
- Linux
|
||||
- macOS
|
||||
- Windows
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: os_version
|
||||
attributes:
|
||||
label: "OS Version"
|
||||
description: "What OS version does this relate to?"
|
||||
placeholder: "i.e. OS: Windows 7/8/10/11 ..., Ubuntu 22.04/Fedora 36 ..., macOS 10.15/11.1/12.3 ..."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: system_info
|
||||
attributes:
|
||||
label: Additional system information
|
||||
description: For the performance issue, please also show the CPU, Memory information; For the 3D Rendering issue, please also show the Display Card information.
|
||||
placeholder: |
|
||||
CPU: 11th gen Intel r core tm i7-1185g7/AMD Ryzen 7 6800h/...
|
||||
Memory: 32/16 GB...
|
||||
Display Card: NVIDIA Quadro P400/...
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: printer
|
||||
attributes:
|
||||
label: Printer
|
||||
description: Which printer was selected
|
||||
placeholder: Voron 2.4/VzBot/Prusa MK4/Bambu Lab X1 series/Bambu Lab P1P/...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduce_steps
|
||||
attributes:
|
||||
label: How to reproduce
|
||||
description: Please described the detailed steps to reproduce this issue
|
||||
placeholder: |
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
3. Scroll down to '...'
|
||||
4. See error
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual_results
|
||||
attributes:
|
||||
label: Actual results
|
||||
description: What happens after the above steps? Please, enclose a screenshot whenever possible (even when you think the description is clear).
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected_results
|
||||
attributes:
|
||||
label: Expected results
|
||||
description: What should happen after the above steps?
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
id: file_required
|
||||
attributes:
|
||||
value: |
|
||||
Please be sure to add the following files:
|
||||
* Please upload a ZIP archive containing the **project file** used when the problem arise. Please export it just before or after the problem occurs. Even if you did nothing and/or there is no object, export it! (We need the configurations in project file).
|
||||
You can export the project file from the application menu in `File`->`Save project as...`, then zip it
|
||||
* A **log file** for crashes and similar issues.
|
||||
You can find your log file here:
|
||||
Windows: `%APPDATA%\OrcaSlicer\log` or usually `C:\Users\<your username>\AppData\Roaming\OrcaSlicer\log`
|
||||
MacOS: `$HOME/Library/Application Support/OrcaSlicer/log`
|
||||
Linux: `$HOME/.config/OrcaSlicer/log`
|
||||
If Orca Slicer still starts, you can also reach this directory from the application menu in `Help` -> `Show Configuration Folder`
|
||||
You can zip the log directory, or just select the newest logs when this issue happens, and zip them
|
||||
- type: textarea
|
||||
id: file_uploads
|
||||
attributes:
|
||||
label: Project file & Debug log uploads
|
||||
description: Drop the project file and debug log here
|
||||
placeholder: |
|
||||
Project File: `File` -> `Save project as...` then zip it & drop it here
|
||||
Log File: `Help` -> `Show Configuration Folder`, then zip the log directory, or just select the newest logs in `log` when this issue happens and zip them, then drop the zip file here
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: file_checklist
|
||||
attributes:
|
||||
label: Checklist of files to include
|
||||
options:
|
||||
- label: Log file
|
||||
- label: Project file
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Anything else?
|
||||
description: |
|
||||
Screenshots? References? Anything that will give us more context about the issue you are encountering!
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
|
||||
validations:
|
||||
required: false
|
||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Community Support (Discord channel)
|
||||
url: https://discord.gg/P4VE9UY9gJ
|
||||
about: Please ask and answer support "how do I?"questions here.
|
||||
- name: Discussion Forum
|
||||
url: https://github.com/SoftFever/OrcaSlicer/discussions
|
||||
about: Please raise ideas and feature suggestions here.
|
||||
66
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,66 +0,0 @@
|
||||
name: 🚀 Feature Request / Enhancement
|
||||
description: Suggest an improvement to make Orca Slicer even better!
|
||||
labels: ["enhancement"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this feature request!
|
||||
|
||||
If your idea is still at the formulation stage, or you're not sure it would
|
||||
be useful to many users, you can raise it as a discussion topic under [Ideas](https://github.com/SoftFever/OrcaSlicer/discussions/categories/ideas)
|
||||
or you can raise it on the [Discord server](https://discord.gg/P4VE9UY9gJ).
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this feature request?
|
||||
description: |
|
||||
Please search to see if an issue already exists for a feature, or perhaps one similar.
|
||||
You can then comment and react so that we know know much interest there is in the feature request.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Is your feature request related to a problem?
|
||||
description: A clear and concise description of what the problem is.
|
||||
placeholder: I'm always frustrated when [...]
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Which printers will be beneficial to this feature?
|
||||
description: Select affected printer firmware type.
|
||||
multiple: true
|
||||
options:
|
||||
- Klipper
|
||||
- Marlin
|
||||
- Others
|
||||
- All
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the solution you'd like
|
||||
description: A clear and concise description of what you want to happen.
|
||||
placeholder: It should do [...]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe alternatives you've considered
|
||||
description: A clear and concise description of any alternative solutions or features you've considered.
|
||||
placeholder: |
|
||||
1. [...]
|
||||
2. [...]
|
||||
3. [...]
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: |
|
||||
Add any other context, diagrams, illustations or screenshots about the feature request here.
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
|
||||
validations:
|
||||
required: false
|
||||
18
.github/dependabot.yml
vendored
@@ -1,18 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Only care about major updates to github actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
ignore: # Only suggest major updates for built-in actions
|
||||
- dependency-name: "github/*"
|
||||
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
|
||||
- dependency-name: "actions/*"
|
||||
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
|
||||
# Docker dependencies
|
||||
- package-ecosystem: "docker"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
# no support for c/cpp
|
||||
21
.github/pull_request_template.md
vendored
@@ -1,21 +0,0 @@
|
||||
# Description
|
||||
|
||||
<!--
|
||||
> Please provide a summary of the changes made in this PR. Include details such as:
|
||||
> * What issue does this PR address or fix?
|
||||
> * What new features or enhancements does this PR introduce?
|
||||
> * Are there any breaking changes or dependencies that need to be considered?
|
||||
-->
|
||||
|
||||
# Screenshots/Recordings/Graphs
|
||||
|
||||
<!--
|
||||
> Please attach relevant screenshots to showcase the UI changes.
|
||||
> Please attach images that can help explain the changes.
|
||||
-->
|
||||
|
||||
## Tests
|
||||
|
||||
<!--
|
||||
> Please describe the tests that you have conducted to verify the changes made in this PR.
|
||||
-->
|
||||
115
.github/workflows/build_all.yml
vendored
@@ -1,115 +0,0 @@
|
||||
name: Build all
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- release/*
|
||||
paths:
|
||||
- 'deps/**'
|
||||
- 'src/**'
|
||||
- '**/CMakeLists.txt'
|
||||
- 'version.inc'
|
||||
- 'localization/**'
|
||||
- 'resources/**'
|
||||
- ".github/workflows/build_*.yml"
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- release/*
|
||||
paths:
|
||||
- 'deps/**'
|
||||
- 'src/**'
|
||||
- '**/CMakeLists.txt'
|
||||
- 'version.inc'
|
||||
- ".github/workflows/build_*.yml"
|
||||
- 'BuildLinux.sh'
|
||||
- 'build_release_vs2022.bat'
|
||||
- 'build_release_macos.sh'
|
||||
|
||||
workflow_dispatch: # allows for manual dispatch
|
||||
inputs:
|
||||
build-deps-only:
|
||||
description: 'Only build dependencies (bypasses caching)'
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
jobs:
|
||||
build_all:
|
||||
name: Build All
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-24.04
|
||||
- os: windows-latest
|
||||
- os: macos-14
|
||||
arch: x86_64
|
||||
- os: macos-14
|
||||
arch: arm64
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
with:
|
||||
os: ${{ matrix.os }}
|
||||
arch: ${{ matrix.arch }}
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
secrets: inherit
|
||||
flatpak:
|
||||
name: "Flatpak"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
date:
|
||||
ver:
|
||||
ver_pure:
|
||||
container:
|
||||
image: bilelmoussaoui/flatpak-github-actions:gnome-46
|
||||
options: --privileged
|
||||
volumes:
|
||||
- /usr/local/lib/android:/usr/local/lib/android
|
||||
- /usr/share/dotnet:/usr/share/dotnet
|
||||
- /opt/ghc:/opt/ghc1
|
||||
- /usr/local/share/boost:/usr/local/share/boost1
|
||||
steps:
|
||||
- name: "Remove unneeded stuff to free disk space"
|
||||
run:
|
||||
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*"
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get the version and date
|
||||
run: |
|
||||
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
ver="PR-${{ github.event.number }}"
|
||||
else
|
||||
ver=V$ver_pure
|
||||
fi
|
||||
echo "ver=$ver" >> $GITHUB_ENV
|
||||
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
||||
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
|
||||
with:
|
||||
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}.flatpak
|
||||
manifest-path: flatpak/io.github.softfever.OrcaSlicer.yml
|
||||
cache: true
|
||||
upload-artifact: false
|
||||
- name: Upload artifacts Flatpak
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OrcaSlicer-Linux-flatpak_${{ env.ver }}.flatpak
|
||||
path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}.flatpak'
|
||||
- name: Deploy Flatpak to nightly release
|
||||
if: ${{github.ref == 'refs/heads/main'}}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}.flatpak
|
||||
asset_name: OrcaSlicer-Linux-flatpak_${{ env.ver }}.flatpak
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
60
.github/workflows/build_check_cache.yml
vendored
@@ -1,60 +0,0 @@
|
||||
name: Check Cache
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
os:
|
||||
required: true
|
||||
type: string
|
||||
arch:
|
||||
required: false
|
||||
type: string
|
||||
build-deps-only:
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
check_cache: # determines if there is a cache and outputs variables used in caching process
|
||||
name: Check Cache
|
||||
runs-on: ${{ inputs.os }}
|
||||
outputs:
|
||||
cache-key: ${{ steps.set_outputs.outputs.cache-key }}
|
||||
cache-path: ${{ steps.set_outputs.outputs.cache-path }}
|
||||
valid-cache: ${{ steps.cache_deps.outputs.cache-hit }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: 'true'
|
||||
|
||||
- name: set outputs
|
||||
id: set_outputs
|
||||
env:
|
||||
underscore-arch: ${{ inputs.os == 'macos-14' && '_' || ''}}${{ inputs.os == 'macos-14' && inputs.arch || '' }} # if is macos, make a string that does "_{arch}", else output nothing
|
||||
dash-arch: ${{ inputs.os == 'macos-14' && '-' || ''}}${{ inputs.os == 'macos-14' && inputs.arch || '' }} # if is macos, make a string that does "-{arch}", else output nothing
|
||||
dep-folder-name: ${{ (inputs.os == 'windows-latest' || inputs.os == 'macos-14') && 'OrcaSlicer_dep' || 'destdir' }}
|
||||
output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
|
||||
run: |
|
||||
echo cache-key=${{ inputs.os }}${{ env.dash-arch }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
|
||||
echo cache-path=${{ github.workspace }}/deps/build${{ env.underscore-arch }}/${{ env.dep-folder-name }}${{ env.underscore-arch }} >> ${{ env.output-cmd }}
|
||||
|
||||
- name: load cache
|
||||
id: cache_deps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.set_outputs.outputs.cache-path }}
|
||||
key: ${{ steps.set_outputs.outputs.cache-key }}
|
||||
lookup-only: true
|
||||
|
||||
build_deps: # call next step
|
||||
name: Build Deps
|
||||
needs: [check_cache]
|
||||
uses: ./.github/workflows/build_deps.yml
|
||||
with:
|
||||
cache-key: ${{ needs.check_cache.outputs.cache-key }}
|
||||
cache-path: ${{ needs.check_cache.outputs.cache-path }}
|
||||
valid-cache: ${{ needs.check_cache.outputs.valid-cache == 'true' }}
|
||||
os: ${{ inputs.os }}
|
||||
arch: ${{ inputs.arch }}
|
||||
build-deps-only: ${{ inputs.build-deps-only }}
|
||||
secrets: inherit
|
||||
147
.github/workflows/build_deps.yml
vendored
@@ -1,147 +0,0 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
cache-key:
|
||||
required: true
|
||||
type: string
|
||||
cache-path:
|
||||
required: true
|
||||
type: string
|
||||
valid-cache:
|
||||
required: true
|
||||
type: boolean
|
||||
os:
|
||||
required: true
|
||||
type: string
|
||||
arch:
|
||||
required: false
|
||||
type: string
|
||||
build-deps-only:
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
build_deps:
|
||||
name: Build Deps
|
||||
if: inputs.build-deps-only || inputs.valid-cache != true
|
||||
runs-on: ${{ inputs.os }}
|
||||
env:
|
||||
date:
|
||||
steps:
|
||||
|
||||
# Setup the environment
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: 'true'
|
||||
|
||||
- name: load cached deps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ inputs.cache-path }}
|
||||
key: ${{ inputs.cache-key }}
|
||||
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
||||
|
||||
- name: setup dev on Windows
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Get the date on Ubuntu and macOS
|
||||
if: inputs.os != 'windows-latest'
|
||||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Get the date on Windows
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
shell: pwsh
|
||||
|
||||
|
||||
# Build Dependencies
|
||||
- name: Build on Windows
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
choco install strawberryperl
|
||||
.\build_release_vs2022.bat deps
|
||||
.\build_release_vs2022.bat pack
|
||||
cd ${{ github.workspace }}/deps/build
|
||||
|
||||
- name: Build on Mac ${{ inputs.arch }}
|
||||
if: inputs.os == 'macos-14'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
brew install automake texinfo ninja libtool
|
||||
brew list
|
||||
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}
|
||||
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep_${{ inputs.arch }}
|
||||
brew uninstall --ignore-dependencies zstd
|
||||
./build_release_macos.sh -dpx -a ${{ inputs.arch }} -t 10.15 -1
|
||||
brew install zstd
|
||||
|
||||
|
||||
- name: Install Ubuntu Build Dependencies
|
||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
apt-cmd: ${{ (inputs.os == 'ubuntu-20.04' && 'apt-fast') || (inputs.os == 'ubuntu-24.04' && 'sudo apt-get') || '' }}
|
||||
webkit-ver: ${{ (inputs.os == 'ubuntu-20.04' && '4.0') || (inputs.os == 'ubuntu-24.04' && '4.1') || '' }}
|
||||
run: |
|
||||
${{ env.apt-cmd }} update
|
||||
${{ env.apt-cmd }} install -y cmake git g++ build-essential libgl1-mesa-dev m4 \
|
||||
libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules pkgconf \
|
||||
libglu1-mesa-dev libcairo2-dev libgtk-3-dev libsoup2.4-dev libwebkit2gtk-${{ env.webkit-ver }}-dev \
|
||||
libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev \
|
||||
gstreamer1.0-plugins-bad libosmesa6-dev wget sudo autoconf curl libunwind-dev texinfo
|
||||
|
||||
- name: Build on Ubuntu
|
||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/deps/build
|
||||
mkdir -p ${{ github.workspace }}/deps/build/destdir
|
||||
sudo ./BuildLinux.sh -ur
|
||||
sudo chown $USER -R ./
|
||||
./BuildLinux.sh -dr
|
||||
cd deps/build
|
||||
tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
|
||||
|
||||
|
||||
# Upload Artifacts
|
||||
- name: Upload Mac ${{ inputs.arch }} artifacts
|
||||
if: inputs.os == 'macos-14'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OrcaSlicer_dep_mac_${{ inputs.arch }}_${{ env.date }}
|
||||
path: ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep*.tar.gz
|
||||
|
||||
- name: Upload Windows artifacts
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OrcaSlicer_dep_win64_${{ env.date }}
|
||||
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
|
||||
|
||||
- name: Upload Ubuntu artifacts
|
||||
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
|
||||
env:
|
||||
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }}
|
||||
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
|
||||
|
||||
build_orca:
|
||||
name: Build OrcaSlicer
|
||||
needs: [build_deps]
|
||||
if: ${{ !cancelled() && !inputs.build-deps-only && (inputs.valid-cache == true && needs.build_deps.result == 'skipped') || (inputs.valid-cache != true && success()) }}
|
||||
uses: ./.github/workflows/build_orca.yml
|
||||
with:
|
||||
cache-key: ${{ inputs.cache-key }}
|
||||
cache-path: ${{ inputs.cache-path }}
|
||||
os: ${{ inputs.os }}
|
||||
arch: ${{ inputs.arch }}
|
||||
secrets: inherit
|
||||
311
.github/workflows/build_orca.yml
vendored
@@ -1,311 +0,0 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
cache-key:
|
||||
required: true
|
||||
type: string
|
||||
cache-path:
|
||||
required: true
|
||||
type: string
|
||||
os:
|
||||
required: true
|
||||
type: string
|
||||
arch:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build_orca:
|
||||
name: Build OrcaSlicer
|
||||
runs-on: ${{ inputs.os }}
|
||||
env:
|
||||
date:
|
||||
ver:
|
||||
ver_pure:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: 'true'
|
||||
|
||||
- name: load cached deps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ inputs.cache-path }}
|
||||
key: ${{ inputs.cache-key }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
||||
|
||||
- name: Get the version and date on Ubuntu and macOS
|
||||
if: inputs.os != 'windows-latest'
|
||||
run: |
|
||||
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
ver="PR-${{ github.event.number }}"
|
||||
else
|
||||
ver=V$ver_pure
|
||||
fi
|
||||
echo "ver=$ver" >> $GITHUB_ENV
|
||||
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
||||
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Get the version and date on Windows
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: |
|
||||
$date = Get-Date -Format 'yyyyMMdd'
|
||||
$ref = "${{ github.ref }}"
|
||||
$eventName = "${{ github.event_name }}"
|
||||
$prNumber = "${{ github.event.number }}"
|
||||
|
||||
if ($eventName -eq 'pull_request') {
|
||||
$ver = "PR" + $prNumber
|
||||
} else {
|
||||
$versionContent = Get-Content version.inc -Raw
|
||||
if ($versionContent -match 'set\(SoftFever_VERSION "(.*?)"\)') {
|
||||
$ver = $matches[1]
|
||||
}
|
||||
$ver = "V$ver"
|
||||
}
|
||||
|
||||
echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
echo "date: ${{ env.date }} version: ${{ env.ver }}"
|
||||
shell: pwsh
|
||||
|
||||
# Mac
|
||||
- name: Install tools mac
|
||||
if: inputs.os == 'macos-14'
|
||||
run: |
|
||||
brew install ninja libtool
|
||||
brew list
|
||||
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}
|
||||
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
|
||||
|
||||
- name: Free disk space
|
||||
if: inputs.os == 'macos-14'
|
||||
run: |
|
||||
df -hI /dev/disk3s1s1
|
||||
sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} +
|
||||
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
|
||||
df -hI /dev/disk3s1s1
|
||||
|
||||
- name: Build slicer mac
|
||||
if: inputs.os == 'macos-14'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
./build_release_macos.sh -s -n -x -a ${{inputs.arch}} -t 10.15 -1
|
||||
|
||||
# Thanks to RaySajuuk, it's working now
|
||||
- name: Sign app and notary
|
||||
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'macos-14'
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
||||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
CERTIFICATE_ID: ${{ secrets.MACOS_CERTIFICATE_ID }}
|
||||
run: |
|
||||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
|
||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
|
||||
security create-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
|
||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
|
||||
security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $KEYCHAIN_PATH
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/OrcaSlicer.app
|
||||
ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications
|
||||
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.APPLE_DEV_ACCOUNT }}" --team-id "${{ secrets.TEAM_ID }}" --password "${{ secrets.APP_PWD }}"
|
||||
xcrun notarytool submit "OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait
|
||||
xcrun stapler staple OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
|
||||
- name: Create DMG without notary
|
||||
if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications
|
||||
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
|
||||
- name: Upload artifacts mac
|
||||
if: inputs.os == 'macos-14'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
|
||||
- name: Deploy Mac release
|
||||
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
asset_name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
|
||||
# Windows
|
||||
- name: setup MSVC
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Install nsis
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: |
|
||||
dir "C:/Program Files (x86)/Windows Kits/10/Include"
|
||||
choco install nsis
|
||||
|
||||
- name: Build slicer Win
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
|
||||
WindowsSDKVersion: '10.0.22000.0\'
|
||||
run: .\build_release_vs2022.bat slicer
|
||||
|
||||
- name: Create installer Win
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
run: |
|
||||
cpack -G NSIS
|
||||
|
||||
- name: Pack app
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
shell: cmd
|
||||
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip OrcaSlicer_Windows_${{ env.ver }}_portable.zip ${{ github.workspace }}/build/OrcaSlicer'
|
||||
|
||||
- name: Pack PDB
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build/src/Release
|
||||
shell: cmd
|
||||
run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb'
|
||||
|
||||
- name: Upload artifacts Win zip
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OrcaSlicer_Windows_${{ env.ver }}_portable
|
||||
path: ${{ github.workspace }}/build/OrcaSlicer
|
||||
|
||||
- name: Upload artifacts Win installer
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OrcaSlicer_Windows_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/build/OrcaSlicer*.exe
|
||||
|
||||
- name: Upload artifacts Win PDB
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: PDB
|
||||
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z
|
||||
|
||||
- name: Deploy Windows release portable
|
||||
if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
|
||||
asset_name: OrcaSlicer_Windows_${{ env.ver }}_portable.zip
|
||||
asset_content_type: application/x-zip-compressed
|
||||
max_releases: 1
|
||||
|
||||
- name: Deploy Windows release installer
|
||||
if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
|
||||
asset_name: OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
|
||||
asset_content_type: application/x-msdownload
|
||||
max_releases: 1
|
||||
|
||||
# Ubuntu
|
||||
- name: Install dependencies
|
||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
||||
env:
|
||||
apt-cmd: ${{ (inputs.os == 'ubuntu-20.04' && 'apt-fast') || (inputs.os == 'ubuntu-24.04' && 'sudo apt-get') || '' }}
|
||||
webkit-ver: ${{ (inputs.os == 'ubuntu-20.04' && '4.0') || (inputs.os == 'ubuntu-24.04' && '4.1') || '' }}
|
||||
libfuse2-pkg: ${{ (inputs.os == 'ubuntu-20.04' && 'libfuse2') || (inputs.os == 'ubuntu-24.04' && 'libfuse2t64') || '' }}
|
||||
run: |
|
||||
${{ env.apt-cmd }} update
|
||||
${{ env.apt-cmd }} install -y autoconf build-essential cmake curl eglexternalplatform-dev \
|
||||
extra-cmake-modules file git libcairo2-dev libcurl4-openssl-dev libdbus-1-dev libglew-dev libglu1-mesa-dev \
|
||||
libglu1-mesa-dev libgstreamer1.0-dev libgstreamerd-3-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \
|
||||
libgtk-3-dev libgtk-3-dev libmspack-dev libosmesa6-dev libsecret-1-dev libsoup2.4-dev libssl-dev libudev-dev libwayland-dev \
|
||||
libwebkit2gtk-${{ env.webkit-ver }}-dev libxkbcommon-dev locales locales-all m4 pkgconf sudo wayland-protocols wget ${{ env.libfuse2-pkg }}
|
||||
|
||||
- name: Install dependencies from BuildLinux.sh
|
||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
||||
shell: bash
|
||||
run: sudo ./BuildLinux.sh -ur
|
||||
|
||||
- name: Fix permissions
|
||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
||||
shell: bash
|
||||
run: sudo chown $USER -R ./
|
||||
|
||||
- name: Build slicer
|
||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
||||
shell: bash
|
||||
env:
|
||||
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
|
||||
run: |
|
||||
./BuildLinux.sh -isr
|
||||
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
chmod +x ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
|
||||
- name: Build orca_custom_preset_tests
|
||||
if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04'
|
||||
working-directory: ${{ github.workspace }}/build/src
|
||||
shell: bash
|
||||
run: |
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -g 1
|
||||
cd ${{ github.workspace }}/resources/profiles
|
||||
zip -r orca_custom_preset_tests.zip user/
|
||||
|
||||
- name: Upload artifacts Ubuntu
|
||||
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
|
||||
env:
|
||||
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
|
||||
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
|
||||
path: './build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage'
|
||||
|
||||
- name: Deploy Ubuntu release
|
||||
if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }}
|
||||
env:
|
||||
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
asset_name: OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
|
||||
- name: Deploy orca_custom_preset_tests
|
||||
if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' }}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/resources/profiles/orca_custom_preset_tests.zip
|
||||
asset_name: orca_custom_preset_tests.zip
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1
|
||||
44
.github/workflows/check_locale.yml
vendored
@@ -1,44 +0,0 @@
|
||||
name: Check locale
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'localization/**'
|
||||
- ".github/workflows/check_locale.yml"
|
||||
|
||||
jobs:
|
||||
check_translation:
|
||||
name: Check translation
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install gettext
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gettext
|
||||
|
||||
# don't call ./run_gentext.sh as most translators never sync with main branch...
|
||||
- name: Check translation format
|
||||
run: |
|
||||
echo $PWD
|
||||
pot_file="./localization/i18n/OrcaSlicer.pot"
|
||||
for dir in ./localization/i18n/*/
|
||||
do
|
||||
dir=${dir%*/} # remove the trailing "/"
|
||||
lang=${dir##*/} # extract the language identifier
|
||||
|
||||
if [ -f "$dir/OrcaSlicer_${lang}.po" ]; then
|
||||
mkdir -p ./resources/i18n/${lang}/
|
||||
msgfmt --check-format -o ./resources/i18n/${lang}/OrcaSlicer.mo $dir/OrcaSlicer_${lang}.po
|
||||
# Check the exit status of the msgfmt command
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error encountered with msgfmt command for language ${lang}."
|
||||
exit 1 # Exit the script with an error status
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
51
.github/workflows/check_profiles.yml
vendored
@@ -1,51 +0,0 @@
|
||||
name: Check profiles
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'resources/profiles/**'
|
||||
- ".github/workflows/check_profiles.yml"
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
logLevel:
|
||||
description: 'Log level'
|
||||
required: true
|
||||
default: 'warning'
|
||||
|
||||
|
||||
jobs:
|
||||
check_translation:
|
||||
name: Check profiles
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run extra JSON check
|
||||
run: |
|
||||
python3 ./scripts/orca_extra_profile_check.py
|
||||
|
||||
# download
|
||||
- name: Download
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
curl -LJO https://github.com/SoftFever/Orca_tools/releases/download/1/OrcaSlicer_profile_validator
|
||||
chmod +x ./OrcaSlicer_profile_validator
|
||||
|
||||
# validate profiles
|
||||
- name: validate system profiles
|
||||
run: |
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2
|
||||
|
||||
- name: validate custom presets
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
curl -LJO https://github.com/SoftFever/OrcaSlicer/releases/download/nightly-builds/orca_custom_preset_tests.zip
|
||||
unzip ./orca_custom_preset_tests.zip -d ${{ github.workspace }}/resources/profiles
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2
|
||||
|
||||
|
||||
|
||||
|
||||
71
.github/workflows/orca_bot.yml
vendored
@@ -1,71 +0,0 @@
|
||||
name: Orca bot
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
logLevel:
|
||||
description: 'Log level'
|
||||
required: true
|
||||
default: 'warning'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
contents: write # only for delete-branch option
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
# PAT for GitHub API authentication
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Max number of operations per run
|
||||
operations-per-run: 1000
|
||||
# Order to get issues/PRs
|
||||
ascending: true
|
||||
|
||||
# ISSUES
|
||||
# Do not auto-close an issue if it is assigned to a milestone
|
||||
exempt-all-issue-milestones: true
|
||||
# Exempt all issues with assignees from stale
|
||||
exempt-all-issue-assignees: true
|
||||
# Idle number of days before marking issues stale
|
||||
days-before-issue-stale: 90
|
||||
# Idle number of days before marking issues close
|
||||
days-before-issue-close: 7
|
||||
# Label to apply on staled issues
|
||||
stale-issue-label: "stale"
|
||||
# Issue close reason
|
||||
close-issue-reason: not_planned
|
||||
# Remove stale label from issues on updates
|
||||
remove-issue-stale-when-updated: true
|
||||
# Issue stale message
|
||||
stale-issue-message: "Orca bot: this issue is stale because it has been open for 90 days with no activity."
|
||||
# Issue closure message
|
||||
close-issue-message: "Orca bot: This issue was closed because it has been inactive for 7 days since being marked as stale."
|
||||
|
||||
# PRs
|
||||
# Do not auto-close a PR if it is assigned to a milestone
|
||||
exempt-all-pr-milestones: true
|
||||
# Exempt all PRs with assignees from stale
|
||||
exempt-all-pr-assignees: true
|
||||
# Skip the stale action for draft PRs
|
||||
exempt-draft-pr: true
|
||||
# Idle number of days before marking PRs stale
|
||||
days-before-pr-stale: -1
|
||||
# Idle number of days before marking PRs close
|
||||
days-before-pr-close: -1
|
||||
# Label to apply on staled PRs
|
||||
stale-pr-label: "stale"
|
||||
# Label to apply on closed PRs
|
||||
close-pr-label: not_planned
|
||||
# Remove stale label from PRs on updates
|
||||
remove-pr-stale-when-updated: true
|
||||
# PR stale message
|
||||
stale-pr-message: "Orca bot: this PR is stale because it has been open for XX days with no activity."
|
||||
# PR closure message
|
||||
close-pr-message: "Orca bot: This PR was closed because it has been inactive for X days since being marked as stale."
|
||||
# Delete branch after closing a stale PR
|
||||
delete-branch: true
|
||||
46
.github/workflows/publish_docs_to_wiki.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: Publish docs to Wiki
|
||||
|
||||
# Trigger this action only if there are changes pushed to the doc/** directory under the main branch
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- doc/** # This includes all sub folders
|
||||
branches:
|
||||
- main # This can be changed to any branch of your preference
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
logLevel:
|
||||
description: 'Log level'
|
||||
required: true
|
||||
default: 'warning'
|
||||
|
||||
env:
|
||||
USER_TOKEN: ${{ secrets.GH_WIKI_PAT }} # This is the repository secret personal access token
|
||||
USER_NAME: ${{ vars.BOT_USER_NAME }} # Enter the username of your (bot) account
|
||||
OWNER: ${{ github.event.repository.owner.name }} # This is the repository owner
|
||||
REPOSITORY_NAME: ${{ github.event.repository.name }} # This is the repository name
|
||||
|
||||
jobs:
|
||||
publish_docs_to_wiki:
|
||||
name: Publish docs to Wiki
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 1. Clone the current wiki master branch to a folder named `tmp_wiki`
|
||||
- name: Pull content from wiki
|
||||
run: |
|
||||
git config --global user.name "$USER_NAME"
|
||||
git config --global user.email "$USER_NAME"@users.noreply.github.com
|
||||
git clone https://"$USER_TOKEN"@github.com/SoftFever/"$REPOSITORY_NAME".wiki.git tmp_wiki
|
||||
# 4. Synchronize differences between `doc` & `tmp_wiki`
|
||||
# 5. Push new Wiki content
|
||||
- name: Push main repo content to wiki
|
||||
run: |
|
||||
rsync -av --delete doc/ tmp_wiki/ --exclude .git
|
||||
cd tmp_wiki
|
||||
git add .
|
||||
git commit -m "Updated Wiki content"
|
||||
git push origin master
|
||||
38
.github/workflows/update-translation.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Update Translation Catalog
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: 0 0 * * 1
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update_translation:
|
||||
name: Update translation
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install gettext
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gettext
|
||||
|
||||
- name: Update translation catalog
|
||||
run: |
|
||||
./run_gettext.sh --full
|
||||
git add localization/i18n/*
|
||||
|
||||
- name: Commit translation catalog updates
|
||||
uses: qoomon/actions--create-commit@v1
|
||||
id: commit
|
||||
with:
|
||||
message: Update translation catalog
|
||||
skip-empty: true
|
||||
|
||||
- name: Push changes
|
||||
run: git push
|
||||
22
.gitignore
vendored
@@ -1,7 +1,7 @@
|
||||
Build
|
||||
Build.bat
|
||||
/build*/
|
||||
deps/build*
|
||||
/build/
|
||||
deps/build
|
||||
MYMETA.json
|
||||
MYMETA.yml
|
||||
_build
|
||||
@@ -18,20 +18,8 @@ local-lib
|
||||
/src/TAGS
|
||||
/.vscode/
|
||||
build-linux/*
|
||||
deps/build*/*
|
||||
deps/build-linux/*
|
||||
**/.DS_Store
|
||||
install_*
|
||||
build_*/
|
||||
install_dir
|
||||
install_release
|
||||
SVG
|
||||
src/OrcaSlicer-doc/
|
||||
.idea/
|
||||
/.cache/
|
||||
*.mo
|
||||
**/process_full/
|
||||
**/machine_full/
|
||||
**/filament_full/
|
||||
/deps/DL_CACHE/
|
||||
/deps/DL_CACHE
|
||||
**/.flatpak-builder/
|
||||
resources/profiles/user/default
|
||||
*.code-workspace
|
||||
|
||||
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
2
.idea/OrcaSlicer.iml
generated
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
7
.idea/codeStyles/Project.xml
generated
@@ -1,7 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<clangFormatSettings>
|
||||
<option name="ENABLED" value="true" />
|
||||
</clangFormatSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
@@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
||||
4
.idea/misc.xml
generated
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/OrcaSlicer.iml" filepath="$PROJECT_DIR$/.idea/OrcaSlicer.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
103
BambuStudio.sublime-project
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"build_systems":
|
||||
[
|
||||
{
|
||||
"name": "List",
|
||||
//"file_regex": " at ([^-\\s]*) line ([0-9]*)",
|
||||
// "file_regex": " at (D\\:\\/src\\/Slic3r\\/.*?) line ([0-9]*)",
|
||||
"shell_cmd": "ls -l"
|
||||
},
|
||||
{
|
||||
"name": "Run",
|
||||
"working_dir": "$project_path",
|
||||
"file_regex": " at (.*?) line ([0-9]*)",
|
||||
// "shell_cmd": "chdir & perl slic3r.pl --DataDir \"C:\\Users\\Public\\Documents\\Prusa3D\\Slic3r settings MK2\" --gui \"..\\Slic3r-tests\\gap fill torture 20 -rt.stl\""
|
||||
"shell_cmd": "chdir & perl slic3r.pl"
|
||||
},
|
||||
{
|
||||
"name": "full",
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"shell_cmd": "chdir & perl Build.pl"
|
||||
},
|
||||
{
|
||||
"name": "xs",
|
||||
"working_dir": "$project_path/build",
|
||||
// for Visual Studio:
|
||||
"file_regex": "^(..[^:]*)\\(([0-9]+)\\)(.*)$",
|
||||
// For GCC:
|
||||
// "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"shell_cmd": "chdir & ninja -j 6 -v",
|
||||
"env": {
|
||||
// "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",
|
||||
// "PERL_CPANM_HOME": "c:\\wperl64d\\cpanm",
|
||||
// "WXDIR": "D:\\src-perl\\wxWidgets-3.0.3-beta1",
|
||||
// "BOOST_DIR": "D:\\src-perl\\boost_1_61_0",
|
||||
// "BOOST_INCLUDEDIR": "D:\\src-perl\\boost_1_61_0",
|
||||
// "BOOST_LIBRARYDIR": "D:\\src-perl\\boost_1_61_0\\stage\\x64\\lib",
|
||||
// "SLIC3R_STATIC": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "xs & run",
|
||||
"working_dir": "$project_path/build",
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"shell_cmd": "chdir & ninja -j 6 & cd .. & perl slic3r.pl --gui \"..\\Slic3r-tests\\star3-big2.stl\""
|
||||
},
|
||||
{
|
||||
"name": "Slic3r - clean",
|
||||
"working_dir": "$project_path/build",
|
||||
"file_regex": "^(..[^:]*)(?::|\\()([0-9]+)(?::|\\))(?:([0-9]+):)?\\s*(.*)",
|
||||
"shell_cmd": ["chdir & ninja clean"]
|
||||
},
|
||||
{
|
||||
"name": "run tests",
|
||||
"working_dir": "$project_path/build",
|
||||
// for Visual Studio:
|
||||
"file_regex": "^(..[^:]*)\\(([0-9]+)\\)(.*)$",
|
||||
"shell_cmd": "chdir & ctest --verbose"
|
||||
},
|
||||
{
|
||||
"name": "Clean & Configure",
|
||||
"working_dir": "$project_path",
|
||||
// for Visual Studio:
|
||||
"file_regex": "^(..[^:]*)(?::|\\()([0-9]+)(?::|\\))(?:([0-9]+):)?\\s*(.*)",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name": "Configure",
|
||||
"working_dir": "$project_path/build",
|
||||
// for Visual Studio:
|
||||
"file_regex": "^(..[^:]*)(?::|\\()([0-9]+)(?::|\\))(?:([0-9]+):)?\\s*(.*)",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"folders":
|
||||
[
|
||||
{
|
||||
"path": ".",
|
||||
// "folder_exclude_patterns": [".svn", "._d", ".metadata", ".settings"],
|
||||
"file_exclude_patterns": ["XS.c", "*.pch", "*.ilk", "*.js" ]
|
||||
}
|
||||
],
|
||||
|
||||
"settings":
|
||||
{
|
||||
"sublimegdb_workingdir": "${folder:${project_path:run}}",
|
||||
// NOTE: You MUST provide --interpreter=mi for the plugin to work
|
||||
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi -ex 'target localhost:2345'",
|
||||
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi perl --args perl slic3r.pl",
|
||||
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi perl --args slic3r.pl ",
|
||||
// "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",
|
||||
"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",
|
||||
// "sublimegdb_commandline": "D:\\Qt\\Tools\\mingw492_32\\bin\\gdb.exe --interpreter=mi -x slic3r.gdb",
|
||||
// "arguments": "slic3r -j 1 --gui ../Slic3r-tests/star3-big.stl",
|
||||
// "arguments": "../slic3r.pl -j 1 --gui",
|
||||
// "sublimegdb_exec_cmd": "-exec-continue",
|
||||
|
||||
// Add "pending breakpoints" for symbols that are dynamically loaded from
|
||||
// external shared libraries
|
||||
"debug_ext" : true,
|
||||
"run_after_init": false,
|
||||
"close_views": false
|
||||
}
|
||||
}
|
||||
4
Build.PL
@@ -3,7 +3,7 @@
|
||||
print "This script is currently used for installing Perl dependenices for running\n";
|
||||
print "the libslic3r unit / integration tests through Perl prove.\n";
|
||||
print "If you don't plan to run the unit / integration tests, you don't need to\n";
|
||||
print "install these dependencies to build and run OrcaSlicer.\n";
|
||||
print "install these dependencies to build and run BambuSlicer.\n";
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
@@ -124,7 +124,7 @@ EOF
|
||||
}
|
||||
|
||||
print "\n";
|
||||
print "In the next step, you need to build the OrcaSlicer C++ library.\n";
|
||||
print "In the next step, you need to build the BambuStudio C++ library.\n";
|
||||
print "1) Create a build directory and change to it\n";
|
||||
print "2) run cmake .. -DCMAKE_BUILD_TYPE=Release\n";
|
||||
print "3) run make\n";
|
||||
|
||||
195
BuildLinux.sh
@@ -1,195 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export ROOT=$(dirname $(readlink -f ${0}))
|
||||
|
||||
set -e # exit on first error
|
||||
|
||||
function check_available_memory_and_disk() {
|
||||
FREE_MEM_GB=$(free -g -t | grep 'Mem' | rev | cut -d" " -f1 | rev)
|
||||
MIN_MEM_GB=10
|
||||
|
||||
FREE_DISK_KB=$(df -k . | tail -1 | awk '{print $4}')
|
||||
MIN_DISK_KB=$((10 * 1024 * 1024))
|
||||
|
||||
if [ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]; then
|
||||
echo -e "\nERROR: Orca Slicer Builder requires at least ${MIN_MEM_GB}G of 'available' mem (systen has only ${FREE_MEM_GB}G available)"
|
||||
echo && free -h && echo
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ ${FREE_DISK_KB} -le ${MIN_DISK_KB} ]]; then
|
||||
echo -e "\nERROR: Orca Slicer Builder requires at least $(echo ${MIN_DISK_KB} |awk '{ printf "%.1fG\n", $1/1024/1024; }') (systen has only $(echo ${FREE_DISK_KB} | awk '{ printf "%.1fG\n", $1/1024/1024; }') disk free)"
|
||||
echo && df -h . && echo
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function usage() {
|
||||
echo "Usage: ./BuildLinux.sh [-1][-b][-c][-d][-i][-r][-s][-u]"
|
||||
echo " -1: limit builds to 1 core (where possible)"
|
||||
echo " -b: build in debug mode"
|
||||
echo " -c: force a clean build"
|
||||
echo " -d: build deps (optional)"
|
||||
echo " -h: this help output"
|
||||
echo " -i: Generate appimage (optional)"
|
||||
echo " -r: skip ram and disk checks (low ram compiling)"
|
||||
echo " -s: build orca-slicer (optional)"
|
||||
echo " -u: update and build dependencies (optional and need sudo)"
|
||||
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
|
||||
echo " and then './BuildLinux.sh -dsi'"
|
||||
}
|
||||
|
||||
unset name
|
||||
while getopts ":1bcdghirsu" opt; do
|
||||
case ${opt} in
|
||||
1 )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=1
|
||||
;;
|
||||
b )
|
||||
BUILD_DEBUG="1"
|
||||
;;
|
||||
c )
|
||||
CLEAN_BUILD=1
|
||||
;;
|
||||
d )
|
||||
BUILD_DEPS="1"
|
||||
;;
|
||||
h ) usage
|
||||
exit 0
|
||||
;;
|
||||
i )
|
||||
BUILD_IMAGE="1"
|
||||
;;
|
||||
r )
|
||||
SKIP_RAM_CHECK="1"
|
||||
;;
|
||||
s )
|
||||
BUILD_ORCA="1"
|
||||
;;
|
||||
u )
|
||||
UPDATE_LIB="1"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ${OPTIND} -eq 1 ]
|
||||
then
|
||||
usage
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '"')
|
||||
DISTRIBUTION_LIKE=$(awk -F= '/^ID_LIKE=/ {print $2}' /etc/os-release | tr -d '"')
|
||||
# Check for direct distribution match to Ubuntu/Debian
|
||||
if [ "${DISTRIBUTION}" == "ubuntu" ] || [ "${DISTRIBUTION}" == "linuxmint" ]; then
|
||||
DISTRIBUTION="debian"
|
||||
# Check if distribution is Debian/Ubuntu-like based on ID_LIKE
|
||||
elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" == *"ubuntu"* ]]; then
|
||||
DISTRIBUTION="debian"
|
||||
fi
|
||||
if [ ! -f ./linux.d/${DISTRIBUTION} ]
|
||||
then
|
||||
echo "Your distribution does not appear to be currently supported by these build scripts"
|
||||
exit 1
|
||||
fi
|
||||
source ./linux.d/${DISTRIBUTION}
|
||||
|
||||
echo "FOUND_GTK3=${FOUND_GTK3}"
|
||||
if [[ -z "${FOUND_GTK3_DEV}" ]]
|
||||
then
|
||||
echo "Error, you must install the dependencies before."
|
||||
echo "Use option -u with sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Changing date in version..."
|
||||
{
|
||||
# change date in version
|
||||
sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
|
||||
}
|
||||
echo "done"
|
||||
|
||||
|
||||
if ! [[ -n "${SKIP_RAM_CHECK}" ]]
|
||||
then
|
||||
check_available_memory_and_disk
|
||||
fi
|
||||
|
||||
if [[ -n "${BUILD_DEPS}" ]]
|
||||
then
|
||||
echo "Configuring dependencies..."
|
||||
BUILD_ARGS="-DDEP_WX_GTK3=ON"
|
||||
if [[ -n "${CLEAN_BUILD}" ]]
|
||||
then
|
||||
rm -fr deps/build
|
||||
fi
|
||||
if [ ! -d "deps/build" ]
|
||||
then
|
||||
mkdir deps/build
|
||||
fi
|
||||
if [[ -n "${BUILD_DEBUG}" ]]
|
||||
then
|
||||
# have to build deps with debug & release or the cmake won't find everything it needs
|
||||
if [ ! -d "deps/build/release" ]
|
||||
then
|
||||
mkdir deps/build/release
|
||||
fi
|
||||
cmake -S deps -B deps/build/release -G Ninja -DDESTDIR="${PWD}/deps/build/destdir" -DDEP_DOWNLOAD_DIR="${PWD}/deps/DL_CACHE" ${BUILD_ARGS}
|
||||
cmake --build deps/build/release
|
||||
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug"
|
||||
fi
|
||||
|
||||
echo "cmake -S deps -B deps/build -G Ninja ${BUILD_ARGS}"
|
||||
cmake -S deps -B deps/build -G Ninja ${BUILD_ARGS}
|
||||
cmake --build deps/build
|
||||
fi
|
||||
|
||||
|
||||
if [[ -n "${BUILD_ORCA}" ]]
|
||||
then
|
||||
echo "Configuring OrcaSlicer..."
|
||||
if [[ -n "${CLEAN_BUILD}" ]]
|
||||
then
|
||||
rm -fr build
|
||||
fi
|
||||
BUILD_ARGS=""
|
||||
if [[ -n "${FOUND_GTK3_DEV}" ]]
|
||||
then
|
||||
BUILD_ARGS="-DSLIC3R_GTK=3"
|
||||
fi
|
||||
if [[ -n "${BUILD_DEBUG}" ]]
|
||||
then
|
||||
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug -DBBL_INTERNAL_TESTING=1"
|
||||
else
|
||||
BUILD_ARGS="${BUILD_ARGS} -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0"
|
||||
fi
|
||||
echo -e "cmake -S . -B build -G Ninja -DCMAKE_PREFIX_PATH="${PWD}/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1 ${BUILD_ARGS}"
|
||||
cmake -S . -B build -G Ninja \
|
||||
-DCMAKE_PREFIX_PATH="${PWD}/deps/build/destdir/usr/local" \
|
||||
-DSLIC3R_STATIC=1 \
|
||||
-DORCA_TOOLS=ON \
|
||||
${BUILD_ARGS}
|
||||
echo "done"
|
||||
echo "Building OrcaSlicer ..."
|
||||
cmake --build build --target OrcaSlicer
|
||||
echo "Building OrcaSlicer_profile_validator .."
|
||||
cmake --build build --target OrcaSlicer_profile_validator
|
||||
./run_gettext.sh
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
if [[ -e ${ROOT}/build/src/BuildLinuxImage.sh ]]; then
|
||||
# Give proper permissions to script
|
||||
chmod 755 ${ROOT}/build/src/BuildLinuxImage.sh
|
||||
|
||||
echo "[9/9] Generating Linux app..."
|
||||
pushd build
|
||||
if [[ -n "${BUILD_IMAGE}" ]]
|
||||
then
|
||||
${ROOT}/build/src/BuildLinuxImage.sh -i
|
||||
else
|
||||
${ROOT}/build/src/BuildLinuxImage.sh
|
||||
fi
|
||||
popd
|
||||
echo "done"
|
||||
fi
|
||||
283
CMakeLists.txt
@@ -1,14 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
if (APPLE)
|
||||
# if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3
|
||||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||
endif ()
|
||||
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif ()
|
||||
|
||||
project(OrcaSlicer)
|
||||
project(BambuStudio)
|
||||
|
||||
include("version.inc")
|
||||
include(GNUInstallDirs)
|
||||
@@ -22,18 +13,6 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
|
||||
endif()
|
||||
|
||||
find_package(Git)
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
# Check current Git commit hash
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{SLIC3R_STATIC})
|
||||
set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC})
|
||||
else()
|
||||
@@ -44,11 +23,11 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(SLIC3R_STATIC "Compile OrcaSlicer with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL})
|
||||
option(SLIC3R_GUI "Compile OrcaSlicer with GUI components (OpenGL, wxWidgets)" 1)
|
||||
option(SLIC3R_FHS "Assume OrcaSlicer is to be installed in a FHS directory structure" 0)
|
||||
option(SLIC3R_STATIC "Compile BambuStudio with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL})
|
||||
option(SLIC3R_GUI "Compile BambuStudio with GUI components (OpenGL, wxWidgets)" 1)
|
||||
option(SLIC3R_FHS "Assume BambuStudio is to be installed in a FHS directory structure" 0)
|
||||
option(SLIC3R_WX_STABLE "Build against wxWidgets stable (3.0) as oppsed to dev (3.1) on Linux" 0)
|
||||
option(SLIC3R_PROFILE "Compile OrcaSlicer with an invasive Shiny profiler" 0)
|
||||
option(SLIC3R_PROFILE "Compile BambuStudio with an invasive Shiny profiler" 0)
|
||||
option(SLIC3R_PCH "Use precompiled headers" 1)
|
||||
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
|
||||
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
|
||||
@@ -63,6 +42,7 @@ set(SLIC3R_GTK "2" CACHE STRING "GTK version to use with wxWidgets on Linux")
|
||||
|
||||
set(IS_CROSS_COMPILE FALSE)
|
||||
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
set(CMAKE_FIND_APPBUNDLE LAST)
|
||||
@@ -73,15 +53,11 @@ if (APPLE)
|
||||
if (CMAKE_MACOSX_BUNDLE)
|
||||
set(CMAKE_INSTALL_RPATH @executable_path/../Frameworks)
|
||||
endif()
|
||||
SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.softfever3d.orca-slicer")
|
||||
|
||||
message(STATUS "Orca: IS_CROSS_COMPILE: ${IS_CROSS_COMPILE}")
|
||||
endif ()
|
||||
|
||||
# Proposal for C++ unit tests and sandboxes
|
||||
option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF)
|
||||
option(SLIC3R_BUILD_TESTS "Build unit tests" OFF)
|
||||
option(ORCA_TOOLS "Build Orca tools" OFF)
|
||||
|
||||
if (IS_CROSS_COMPILE)
|
||||
message("Detected cross compilation setup. Tests and encoding checks will be forcedly disabled!")
|
||||
@@ -133,21 +109,14 @@ if (MSVC)
|
||||
# C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data. An integer type is converted to a smaller integer type.
|
||||
# C4267: The compiler detected a conversion from size_t to a smaller type.
|
||||
add_compile_options(/wd4244 /wd4267)
|
||||
# Disable warnings on comparison of unsigned and signed
|
||||
# C4018: signed/unsigned mismatch
|
||||
add_compile_options(/wd4018)
|
||||
endif ()
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
|
||||
add_compile_definitions(BOOST_NO_CXX98_FUNCTION_BASE _HAS_AUTO_PTR_ETC=0)
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
add_compile_options(-Wa,-mbig-obj)
|
||||
endif ()
|
||||
|
||||
if (NOT MSVC)
|
||||
# ARMs (Raspberry PI) use an unsigned char by default. Let's make it consistent for OrcaSlicer on all platforms.
|
||||
# ARMs (Raspberry PI) use an unsigned char by default. Let's make it consistent for BambuStudio on all platforms.
|
||||
add_compile_options(-fsigned-char)
|
||||
endif ()
|
||||
|
||||
@@ -264,22 +233,6 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
|
||||
# On GCC and Clang, no return from a non-void function is a warning only. Here, we make it an error.
|
||||
add_compile_options(-Werror=return-type)
|
||||
|
||||
# Since some portions of code are just commented out or put under conditional compilation, there are
|
||||
# a bunch of warning related to unused functions and variables. Suppress those warnings to not pollute
|
||||
# compilers diagnostics output with warnings we not going to look at
|
||||
add_compile_options(-Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-label -Wno-unused-local-typedefs)
|
||||
|
||||
# Ignore signed/unsigned comparison warnings
|
||||
add_compile_options(-Wno-sign-compare)
|
||||
|
||||
# The mismatch of tabs and spaces throughout the project can sometimes
|
||||
# cause this warning to appear even though the indentation is fine.
|
||||
# Some includes also cause the warning
|
||||
add_compile_options(-Wno-misleading-indentation)
|
||||
|
||||
# Disable warning if enum value does not have a corresponding case in switch statement
|
||||
add_compile_options(-Wno-switch)
|
||||
|
||||
# removes LOTS of extraneous Eigen warnings (GCC only supports it since 6.1)
|
||||
# https://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
||||
@@ -293,31 +246,14 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
|
||||
add_compile_options(-Wno-deprecated-declarations)
|
||||
endif()
|
||||
|
||||
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
|
||||
add_compile_options(-Wno-error=enum-constexpr-conversion)
|
||||
endif()
|
||||
|
||||
#GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
|
||||
# We will turn the warning of for GCC for now:
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
# GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
|
||||
# We will turn the warning of for GCC for now:
|
||||
add_compile_options(-Wno-unknown-pragmas)
|
||||
endif()
|
||||
|
||||
# Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
|
||||
add_compile_options(-gz=zstd)
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=template-id-cdtor" )
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if (SLIC3R_ASAN)
|
||||
@@ -330,8 +266,6 @@ if (SLIC3R_ASAN)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
|
||||
else()
|
||||
add_compile_definitions(_DISABLE_STRING_ANNOTATION=1 _DISABLE_VECTOR_ANNOTATION=1)
|
||||
endif ()
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
@@ -344,11 +278,6 @@ if (APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=partial-availability -Werror=unguarded-availability -Werror=unguarded-availability-new")
|
||||
endif ()
|
||||
|
||||
if(MSVC)
|
||||
# 添加编译选项,忽略警告 C4305 (格式转换截断)
|
||||
add_compile_options(/wd4305)
|
||||
endif()
|
||||
|
||||
# Where all the bundled libraries reside?
|
||||
set(LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
set(LIBDIR_BIN ${CMAKE_CURRENT_BINARY_DIR}/src)
|
||||
@@ -366,8 +295,8 @@ if(WIN32)
|
||||
add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
|
||||
if(MSVC)
|
||||
# BOOST_ALL_NO_LIB: Avoid the automatic linking of Boost libraries on Windows. Rather rely on explicit linking.
|
||||
add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x602 -DBOOST_SYSTEM_USE_UTF8 )
|
||||
# Force the source code encoding to UTF-8. See OrcaSlicer GH pull request #5583
|
||||
add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x601 -DBOOST_SYSTEM_USE_UTF8 )
|
||||
# Force the source code encoding to UTF-8. See BambuStudio GH pull request #5583
|
||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
endif(MSVC)
|
||||
@@ -379,58 +308,38 @@ add_definitions(-DwxUSE_UNICODE -D_UNICODE -DUNICODE -DWXINTL_NO_GETTEXT_MACRO)
|
||||
add_definitions(-DwxNO_UNSAFE_WXSTRING_CONV)
|
||||
|
||||
if (SLIC3R_PROFILE)
|
||||
message("OrcaSlicer will be built with a Shiny invasive profiler")
|
||||
message("BambuStudio will be built with a Shiny invasive profiler")
|
||||
add_definitions(-DSLIC3R_PROFILE)
|
||||
endif ()
|
||||
|
||||
# Disable optimization for RelWithDebInfo
|
||||
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "/O2")
|
||||
string(REGEX REPLACE "/O2" "/Od" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
# Disable optimization even with debugging on.
|
||||
if (0)
|
||||
message(STATUS "Perl compiled without optimization. Disabling optimization for the BambuStudio build.")
|
||||
message("Old CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
message("Old CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
message("Old CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
|
||||
set(CMAKE_C_FLAGS_RELEASE "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
|
||||
set(CMAKE_CXX_FLAGS "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
|
||||
set(CMAKE_C_FLAGS "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "/O2")
|
||||
string(REGEX REPLACE "/O2" "/Od" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "-O2")
|
||||
string(REGEX REPLACE "-O2" "-O0" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "-O2")
|
||||
string(REGEX REPLACE "-O2" "-O0" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "/Ob1")
|
||||
string(REGEX REPLACE "/Ob1" "/Ob0" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
endif()
|
||||
if(CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "/Ob1")
|
||||
string(REGEX REPLACE "/Ob1" "/Ob0" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /RTC1")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /RTC1")
|
||||
endif()
|
||||
|
||||
list(REMOVE_DUPLICATES CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
|
||||
# Find and configure boost
|
||||
if(SLIC3R_STATIC)
|
||||
# Use static boost libraries.
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
# Use boost libraries linked statically to the C++ runtime.
|
||||
# set(Boost_USE_STATIC_RUNTIME ON)
|
||||
else()
|
||||
add_definitions(-DBOOST_LOG_DYN_LINK)
|
||||
endif()
|
||||
#set(Boost_DEBUG ON)
|
||||
# set(Boost_COMPILER "-mgw81")
|
||||
# boost::process was introduced first in version 1.64.0,
|
||||
# boost::beast::detail::base64 was introduced first in version 1.66.0
|
||||
find_package(Boost 1.66 REQUIRED COMPONENTS system filesystem thread log log_setup locale regex chrono atomic date_time iostreams program_options)
|
||||
set(MINIMUM_BOOST_VERSION "1.66.0")
|
||||
set(_boost_components "system;filesystem;thread;log;locale;regex;chrono;atomic;date_time;iostreams")
|
||||
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS ${_boost_components})
|
||||
|
||||
add_library(boost_libs INTERFACE)
|
||||
add_library(boost_headeronly INTERFACE)
|
||||
@@ -456,15 +365,34 @@ function(slic3r_remap_configs targets from_Cfg to_Cfg)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
target_include_directories(boost_headeronly INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
target_link_libraries(boost_libs INTERFACE boost_headeronly ${Boost_LIBRARIES})
|
||||
if(TARGET Boost::system)
|
||||
message(STATUS "Boost::boost exists")
|
||||
target_link_libraries(boost_headeronly INTERFACE Boost::boost)
|
||||
|
||||
# Only from cmake 3.12
|
||||
# list(TRANSFORM _boost_components PREPEND Boost:: OUTPUT_VARIABLE _boost_targets)
|
||||
set(_boost_targets "")
|
||||
foreach(comp ${_boost_components})
|
||||
list(APPEND _boost_targets "Boost::${comp}")
|
||||
endforeach()
|
||||
|
||||
target_link_libraries(boost_libs INTERFACE
|
||||
boost_headeronly # includes the custom compile definitions as well
|
||||
${_boost_targets}
|
||||
)
|
||||
slic3r_remap_configs("${_boost_targets}" RelWithDebInfo Release)
|
||||
else()
|
||||
target_include_directories(boost_headeronly INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
target_link_libraries(boost_libs INTERFACE boost_headeronly ${Boost_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
# Find and configure intel-tbb
|
||||
if(SLIC3R_STATIC)
|
||||
set(TBB_STATIC 1)
|
||||
endif()
|
||||
set(TBB_DEBUG 1)
|
||||
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release "")
|
||||
find_package(TBB REQUIRED)
|
||||
# include_directories(${TBB_INCLUDE_DIRS})
|
||||
# add_definitions(${TBB_DEFINITIONS})
|
||||
@@ -476,8 +404,11 @@ find_package(TBB REQUIRED)
|
||||
# add_definitions(-DTBB_USE_CAPTURED_EXCEPTION=0)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
if (APPLE)
|
||||
find_package(CURL CONFIG REQUIRED)
|
||||
else()
|
||||
find_package(CURL REQUIRED)
|
||||
|
||||
endif()
|
||||
|
||||
add_library(libcurl INTERFACE)
|
||||
target_link_libraries(libcurl INTERFACE CURL::libcurl)
|
||||
@@ -546,35 +477,35 @@ find_package(PNG REQUIRED)
|
||||
set(OpenGL_GL_PREFERENCE "LEGACY")
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
set(GLEW_ROOT "${CMAKE_PREFIX_PATH}")
|
||||
message("GLEW_ROOT: ${GLEW_ROOT}")
|
||||
# Find glew or use bundled version
|
||||
if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_GLEW)
|
||||
set(GLEW_USE_STATIC_LIBS ON)
|
||||
set(GLEW_VERBOSE ON)
|
||||
endif()
|
||||
|
||||
find_package(GLEW REQUIRED)
|
||||
find_package(GLEW)
|
||||
if (NOT TARGET GLEW::GLEW)
|
||||
message(STATUS "GLEW not found, using bundled version.")
|
||||
add_library(glew STATIC ${LIBDIR}/glew/src/glew.c)
|
||||
set(GLEW_FOUND TRUE)
|
||||
set(GLEW_INCLUDE_DIRS ${LIBDIR}/glew/include/)
|
||||
target_compile_definitions(glew PUBLIC GLEW_STATIC)
|
||||
target_include_directories(glew PUBLIC ${GLEW_INCLUDE_DIRS})
|
||||
add_library(GLEW::GLEW ALIAS glew)
|
||||
endif ()
|
||||
|
||||
find_package(glfw3 REQUIRED)
|
||||
|
||||
# Find the Cereal serialization library
|
||||
find_package(cereal REQUIRED)
|
||||
if (NOT TARGET cereal::cereal)
|
||||
set_target_properties(cereal PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
add_library(cereal::cereal ALIAS cereal)
|
||||
else ()
|
||||
set_target_properties(cereal::cereal PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
endif ()
|
||||
|
||||
# l10n
|
||||
set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/i18n")
|
||||
set(BBL_L18N_DIR "${CMAKE_CURRENT_SOURCE_DIR}/localization/i18n")
|
||||
set(BBL_L18N_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bbl/i18n")
|
||||
add_custom_target(gettext_make_pot
|
||||
COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost
|
||||
-f "${BBL_L18N_DIR}/list.txt"
|
||||
-o "${BBL_L18N_DIR}/OrcaSlicer.pot"
|
||||
COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR}
|
||||
-o "${BBL_L18N_DIR}/BambuStudio.pot"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Generate pot file from strings in the source tree"
|
||||
)
|
||||
@@ -582,13 +513,13 @@ add_custom_target(gettext_merge_po_with_pot
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Merge localization po with new generted pot file"
|
||||
)
|
||||
file(GLOB BBL_L10N_PO_FILES "${BBL_L18N_DIR}/*/OrcaSlicer*.po")
|
||||
file(GLOB BBL_L10N_PO_FILES "${BBL_L18N_DIR}/*/BambuStudio*.po")
|
||||
foreach(po_file ${BBL_L10N_PO_FILES})
|
||||
GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY)
|
||||
SET(po_new_file "${po_dir}/OrcaSlicer_.po")
|
||||
SET(po_new_file "${po_dir}/BambuStudio_.po")
|
||||
add_custom_command(
|
||||
TARGET gettext_merge_po_with_pot PRE_BUILD
|
||||
COMMAND msgmerge -N -o ${po_file} ${po_file} "${BBL_L18N_DIR}/OrcaSlicer.pot"
|
||||
COMMAND msgmerge -N -o ${po_file} ${po_file} "${BBL_L18N_DIR}/BambuStudio.pot"
|
||||
DEPENDS ${po_file}
|
||||
)
|
||||
endforeach()
|
||||
@@ -596,11 +527,11 @@ add_custom_target(gettext_po_to_mo
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Generate localization po files (binary) from mo files (texts)"
|
||||
)
|
||||
file(GLOB L10N_PO_FILES "${BBL_L18N_DIR}/*/OrcaSlicer*.po")
|
||||
file(GLOB L10N_PO_FILES "${BBL_L18N_DIR}/*/BambuStudio*.po")
|
||||
foreach(po_file ${BBL_L10N_PO_FILES})
|
||||
GET_FILENAME_COMPONENT(SECOND_FOLDER_ABSOLUTE ${po_file} DIRECTORY)
|
||||
string(REGEX REPLACE ".*/(.*)" "\\1" po_dir "${SECOND_FOLDER_ABSOLUTE}" )
|
||||
SET(mo_file "${L10N_DIR}/${po_dir}/OrcaSlicer.mo")
|
||||
SET(mo_file "${L10N_DIR}/${po_dir}/BambuStudio.mo")
|
||||
add_custom_command(
|
||||
TARGET gettext_po_to_mo PRE_BUILD
|
||||
COMMAND msgfmt ARGS --check-format -o ${mo_file} ${po_file}
|
||||
@@ -627,23 +558,9 @@ else ()
|
||||
"OpenVDB installation with the OPENVDB_FIND_MODULE_PATH cache variable.")
|
||||
endif ()
|
||||
|
||||
find_path(SPNAV_INCLUDE_DIR spnav.h)
|
||||
if (SPNAV_INCLUDE_DIR)
|
||||
find_library(HAVE_SPNAV spnav)
|
||||
if (HAVE_SPNAV)
|
||||
add_definitions(-DHAVE_SPNAV)
|
||||
add_library(libspnav SHARED IMPORTED)
|
||||
target_link_libraries(libspnav INTERFACE spnav)
|
||||
message(STATUS "SPNAV library found")
|
||||
else()
|
||||
message(STATUS "SPNAV library NOT found, Spacenavd not supported")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "SPNAV library NOT found, Spacenavd not supported")
|
||||
endif()
|
||||
|
||||
set(TOP_LEVEL_PROJECT_DIR ${PROJECT_SOURCE_DIR})
|
||||
function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
function(bambustudio_copy_dlls target config postfix output_dlls)
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
set(_bits 64)
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
@@ -695,7 +612,6 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
${CMAKE_PREFIX_PATH}/bin/occt/TKXCAF.dll
|
||||
${CMAKE_PREFIX_PATH}/bin/occt/TKXDESTEP.dll
|
||||
${CMAKE_PREFIX_PATH}/bin/occt/TKXSBase.dll
|
||||
${CMAKE_PREFIX_PATH}/bin/freetype.dll
|
||||
DESTINATION ${_out_dir})
|
||||
|
||||
set(${output_dlls}
|
||||
@@ -730,19 +646,15 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
${_out_dir}/TKXDESTEP.dll
|
||||
${_out_dir}/TKXSBase.dll
|
||||
|
||||
${_out_dir}/freetype.dll
|
||||
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
# libslic3r, OrcaSlicer GUI and the OrcaSlicer executable.
|
||||
# libslic3r, BambuStudio GUI and the BambuStudio executable.
|
||||
add_subdirectory(src)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OrcaSlicer_app_gui)
|
||||
|
||||
add_dependencies(gettext_make_pot hintsToPot)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT BambuStudio_app_gui)
|
||||
|
||||
# Perl bindings, currently only used for the unit / integration tests of libslic3r.
|
||||
# Also runs the unit / integration tests.
|
||||
@@ -759,11 +671,6 @@ if(SLIC3R_BUILD_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if (NOT WIN32 AND NOT APPLE)
|
||||
set(SLIC3R_APP_CMD "orca-slicer")
|
||||
configure_file(${LIBDIR}/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh @ONLY)
|
||||
endif()
|
||||
|
||||
option(BUILD_BBS_TEST_TOOLS "Build bbs test tools" OFF)
|
||||
if(BUILD_BBS_TEST_TOOLS)
|
||||
add_subdirectory(bbs_test_tools)
|
||||
@@ -772,57 +679,25 @@ endif()
|
||||
|
||||
# Resources install target, configure fhs.hpp on UNIX
|
||||
if (WIN32)
|
||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources")
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".")
|
||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
|
||||
elseif (SLIC3R_FHS)
|
||||
# CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share)
|
||||
set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/OrcaSlicer")
|
||||
set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/BambuStudio")
|
||||
install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/ DESTINATION ${SLIC3R_FHS_RESOURCES}
|
||||
PATTERN "*/udev" EXCLUDE
|
||||
)
|
||||
install(FILES src/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
install(FILES src/platform/unix/BambuStudio.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
foreach(SIZE 32 128 192)
|
||||
install(FILES ${SLIC3R_RESOURCES_DIR}/images/OrcaSlicer_${SIZE}px.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME OrcaSlicer.png
|
||||
install(FILES ${SLIC3R_RESOURCES_DIR}/images/BambuStudio_${SIZE}px.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME BambuStudio.png
|
||||
)
|
||||
endforeach()
|
||||
install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/udev/ DESTINATION lib/udev/rules.d)
|
||||
elseif (CMAKE_MACOSX_BUNDLE)
|
||||
# install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/OrcaSlicer.app/Contents/resources")
|
||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/BambuStudio.app/Contents/resources")
|
||||
else ()
|
||||
install(FILES src/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
|
||||
install(FILES src/platform/unix/BambuStudio.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
|
||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
|
||||
endif ()
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION ".")
|
||||
configure_file(${LIBDIR}/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/platform/unix/fhs.hpp)
|
||||
|
||||
set (CPACK_PACKAGE_NAME "OrcaSlicer")
|
||||
set (CPACK_PACKAGE_VENDOR "SoftFever")
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR "${ORCA_VERSION_MAJOR}")
|
||||
set (CPACK_PACKAGE_VERSION_MINOR "${ORCA_VERSION_MINOR}")
|
||||
set (CPACK_PACKAGE_VERSION_PATCH "${ORCA_VERSION_PATCH}")
|
||||
set (CPACK_PACKAGE_FILE_NAME "OrcaSlicer_Windows_Installer_V${SoftFever_VERSION}")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Orca Slicer is an open source slicer for FDM printers")
|
||||
set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/SoftFever/OrcaSlicer")
|
||||
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
|
||||
set (CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/images\\\\OrcaSlicer.ico")
|
||||
set (CPACK_NSIS_MUI_ICON "${CPACK_PACKAGE_ICON}")
|
||||
set (CPACK_NSIS_MUI_UNIICON "${CPACK_PACKAGE_ICON}")
|
||||
set (CPACK_NSIS_INSTALLED_ICON_NAME "$INSTDIR\\\\orca-slicer.exe")
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
|
||||
CreateShortCut \\\"$DESKTOP\\\\OrcaSlicer.lnk\\\" \\\"$INSTDIR\\\\orca-slicer.exe\\\"
|
||||
")
|
||||
set (CPACK_PACKAGE_CHECKSUM SHA256)
|
||||
set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OrcaSlicer")
|
||||
set (CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
set (CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
||||
# set (CPACK_NSIS_MODIFY_PATH "ON")
|
||||
set(CPACK_PACKAGE_EXECUTABLES "orca-slicer;OrcaSlicer")
|
||||
set(CPACK_CREATE_DESKTOP_LINKS "orca-slicer")
|
||||
set (CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt) # must also include in install command
|
||||
|
||||
set(CPACK_WIX_UPGRADE_GUID "058245e8-20e0-4a95-9ab7-1acfe17ad511")
|
||||
set(CPACK_GENERATOR NSIS)
|
||||
include(CPack)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
PROJECT_ROOT=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
|
||||
|
||||
set -x
|
||||
# Wishlist hint: For developers, creating a Docker Compose
|
||||
# setup with persistent volumes for the build & deps directories
|
||||
# would speed up recompile times significantly. For end users,
|
||||
# the simplicity of a single Docker image and a one-time compilation
|
||||
# seems better.
|
||||
docker build -t orcaslicer \
|
||||
--build-arg USER=$USER \
|
||||
--build-arg UID=$(id -u) \
|
||||
--build-arg GID=$(id -g) \
|
||||
--build-arg NCORES=$NCORES \
|
||||
$PROJECT_ROOT
|
||||
29
DockerRun.sh
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
# Just in case, here's some other things that might help:
|
||||
# Force the container's hostname to be the same as your workstation
|
||||
# -h $HOSTNAME \
|
||||
# If there's problems with the X display, try this
|
||||
# -v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
# If you get an error like "Authorization required, but no authorization protocol specified," run line 9 in your terminal before rerunning this program
|
||||
# xhost +local:docker
|
||||
docker run \
|
||||
`# Use the hosts networking. Printer wifi and also dbus communication` \
|
||||
--net=host \
|
||||
`# Some X installs will not have permissions to talk to sockets for shared memory` \
|
||||
--ipc host \
|
||||
`# Run as your workstations username to keep permissions the same` \
|
||||
-u $USER \
|
||||
`# Bind mount your home directory into the container for loading/saving files` \
|
||||
-v $HOME:/home/$USER \
|
||||
`# Pass the X display number to the container` \
|
||||
-e DISPLAY=$DISPLAY \
|
||||
`# It seems that libGL and dbus things need privileged mode` \
|
||||
--privileged=true \
|
||||
`# Attach tty for running orca slicer with command line things` \
|
||||
-ti \
|
||||
`# Clean up after yourself` \
|
||||
--rm \
|
||||
`# Pass all parameters from this script to the orca slicer ENTRYPOINT binary` \
|
||||
orcaslicer $*
|
||||
|
||||
95
Dockerfile
@@ -1,95 +0,0 @@
|
||||
FROM docker.io/ubuntu:24.04
|
||||
LABEL maintainer "DeftDawg <DeftDawg@gmail.com>"
|
||||
|
||||
# Disable interactive package configuration
|
||||
RUN apt-get update && \
|
||||
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||||
|
||||
# Add a deb-src
|
||||
RUN echo deb-src http://archive.ubuntu.com/ubuntu \
|
||||
$(cat /etc/*release | grep VERSION_CODENAME | cut -d= -f2) main universe>> /etc/apt/sources.list
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
autoconf \
|
||||
build-essential \
|
||||
cmake \
|
||||
curl \
|
||||
eglexternalplatform-dev \
|
||||
extra-cmake-modules \
|
||||
file \
|
||||
git \
|
||||
gstreamer1.0-plugins-bad \
|
||||
gstreamer1.0-libav \
|
||||
libcairo2-dev \
|
||||
libcurl4-openssl-dev \
|
||||
libdbus-1-dev \
|
||||
libglew-dev \
|
||||
libglu1-mesa-dev \
|
||||
libglu1-mesa-dev \
|
||||
libgstreamer1.0-dev \
|
||||
libgstreamerd-3-dev \
|
||||
libgstreamer-plugins-base1.0-dev \
|
||||
libgstreamer-plugins-good1.0-dev \
|
||||
libgtk-3-dev \
|
||||
libgtk-3-dev \
|
||||
libosmesa6-dev \
|
||||
libsecret-1-dev \
|
||||
libsoup2.4-dev \
|
||||
libssl3 \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
libudev-dev \
|
||||
libwayland-dev \
|
||||
libwebkit2gtk-4.0-dev \
|
||||
libxkbcommon-dev \
|
||||
locales \
|
||||
locales-all \
|
||||
m4 \
|
||||
pkgconf \
|
||||
sudo \
|
||||
wayland-protocols \
|
||||
wget
|
||||
|
||||
# Change your locale here if you want. See the output
|
||||
# of `locale -a` to pick the correct string formatting.
|
||||
ENV LC_ALL=en_US.utf8
|
||||
RUN locale-gen $LC_ALL
|
||||
|
||||
# Set this so that Orca Slicer doesn't complain about
|
||||
# the CA cert path on every startup
|
||||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
COPY ./ OrcaSlicer
|
||||
|
||||
WORKDIR OrcaSlicer
|
||||
|
||||
# These can run together, but we run them seperate for podman caching
|
||||
# Update System dependencies
|
||||
RUN ./BuildLinux.sh -u
|
||||
|
||||
# Build dependencies in ./deps
|
||||
RUN ./BuildLinux.sh -dr
|
||||
|
||||
# Build slic3r
|
||||
RUN ./BuildLinux.sh -sr
|
||||
|
||||
# Build AppImage
|
||||
ENV container podman
|
||||
RUN ./BuildLinux.sh -ir
|
||||
|
||||
# It's easier to run Orca Slicer as the same username,
|
||||
# UID and GID as your workstation. Since we bind mount
|
||||
# your home directory into the container, it's handy
|
||||
# to keep permissions the same. Just in case, defaults
|
||||
# are root.
|
||||
SHELL ["/bin/bash", "-l", "-c"]
|
||||
ARG USER=root
|
||||
ARG UID=0
|
||||
ARG GID=0
|
||||
RUN [[ "$UID" != "0" ]] \
|
||||
&& groupadd -f -g $GID $USER \
|
||||
&& useradd -u $UID -g $GID $USER
|
||||
|
||||
# Using an entrypoint instead of CMD because the binary
|
||||
# accepts several command line arguments.
|
||||
ENTRYPOINT ["/OrcaSlicer/build/package/bin/orca-slicer"]
|
||||
215
README.md
@@ -1,180 +1,73 @@
|
||||
|
||||
<h1> <p "font-size:200px;"><img align="left" src="https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/OrcaSlicer.ico" width="100"> Orca Slicer</p> </h1>
|
||||
A modified version of Bambu Studio.
|
||||
It has following changes:
|
||||
|
||||
[](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_all.yml)
|
||||
<br>Orca Slicer is an open source slicer for FDM printers.
|
||||
- Support third-party machines:
|
||||
- Voron 2.4
|
||||
- Voron Trident
|
||||
- Voron 0.1
|
||||
- Prusa MK3S
|
||||
- Export to to .gcode file.
|
||||
|
||||
|
||||
Join our Discord community here:<br>
|
||||
<a href="https://discord.gg/P4VE9UY9gJ"><img src="https://img.shields.io/static/v1?message=Discord&logo=discord&label=&color=7289DA&logoColor=white&labelColor=&style=for-the-badge" height="35" alt="discord logo"/> </a>
|
||||
Video: https://youtu.be/zCc7mVwu2xQ
|
||||
|
||||
<h3>🚨🚨🚨Important Security Alert🚨🚨🚨</h3>
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
The only official platforms for OrcaSlicer are **our GitHub project page**, <a href="https://www.orcaslicer.com/">**orcaslicer.com**</a>, and the <a href="https://discord.gg/P4VE9UY9gJ">**official Discord channel**</a>.
|
||||
|
||||
Please be aware that "**orcaslicer.net**", "**orcaslicer.co**" or "**orca-slicer.com**" are NOT an official website for OrcaSlicer and may be potentially malicious. These sites appear to use AI-generated content, lacking genuine context and seems to exist solely to profit from advertisements. Worse, it may redirect download links to harmful sources. For your safety, avoid downloading OrcaSlicer from this site as the links may be compromised.
|
||||
|
||||
If you see the above sites in your searches, report them as spam or unsafe to the search engine. This small action will assist everyone.
|
||||
|
||||
We deeply value our OrcaSlicer community and appreciate all the social groups that support us. However, it is crucial to address the risk posed by any group that falsely claims to be official or misleads its members. If you encounter such a group or are part of one, please assist by encouraging the group owner to add a clear disclaimer or by alerting its members.
|
||||
Image credits:
|
||||
1. Voron 2.4: vorondesign.com
|
||||
2. Voron bed texture: VoronUsers/bryansj
|
||||
3. Voron 0.1: myself
|
||||
4. Prusa MK3S: Prusa3d
|
||||
|
||||
|
||||
=========================SPLIT=========================
|
||||
|
||||
Thank you for your vigilance and support in keeping our community safe!
|
||||

|
||||
# BambuStudio
|
||||
Bambu Studio is a cutting-edge, feature-rich slicing software.
|
||||
It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphic interface, bringing users an incredibly smooth printing experience.
|
||||
|
||||
# Main features
|
||||
- Auto-calibration for all printers
|
||||
- Sandwich (inner-outer-inner) mode - An improved version of the `External Perimeters First` mode
|
||||
- [Precise wall](https://github.com/SoftFever/OrcaSlicer/wiki/Precise-wall)
|
||||
- Polyholes conversion support: [SuperSlicer Wiki: Polyholes](https://github.com/supermerill/SuperSlicer/wiki/Polyholes)
|
||||
- Klipper support
|
||||
- More granular controls
|
||||
- Additional features can be found in the [change notes](https://github.com/SoftFever/OrcaSlicer/releases/)
|
||||
Prebuilt Windows, macOS 64-bit releases are available through the [github releases page](https://github.com/bambulab/BambuStudio/releases/).
|
||||
Linux version currently is not supported.
|
||||
|
||||
# Wiki
|
||||
The wiki below aims to provide a detailed explanation of the slicer settings, including how to maximize their use and how to calibrate and set up your printer.
|
||||
Bambu Studio is based on [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, which is from [Slic3r](https://github.com/Slic3r/Slic3r) by Alessandro Ranellucci and the RepRap community.
|
||||
|
||||
Please note that the wiki is a work in progress. We appreciate your patience as we continue to develop and improve it!
|
||||
See the [wiki](https://github.com/bambulab/BambuStudio/wiki) and the [documentation directory](https://github.com/bambulab/BambuStudio/tree/master/doc) for more informations.
|
||||
|
||||
**[Access the wiki here](https://github.com/SoftFever/OrcaSlicer/wiki)**
|
||||
# What are Bambu Studio's main features?
|
||||
Key features are:
|
||||
- Basic slicing features & GCode viewer
|
||||
- Multiple plates management
|
||||
- Remote control & monitoring
|
||||
- Auto-arrange objects
|
||||
- Auto-orient objects
|
||||
- Hybrid/Tree/Normal support types, Customized support
|
||||
- multi-material printing and rich painting tools
|
||||
- multi-platform (Win/Mac/Linux) support
|
||||
- Global/Object/Part level slicing parameters
|
||||
|
||||
# Download
|
||||
Other major features are:
|
||||
- Advanced cooling logic controlling fan speed and dynamic print speed
|
||||
- Auto brim according to mechanical analysis
|
||||
- Support arc path(G2/G3)
|
||||
- Support STEP format
|
||||
- Assembly & explosion view
|
||||
- Flushing transition-filament into infill/object during filament change
|
||||
|
||||
### Stable Release
|
||||
📥 **[Download the Latest Stable Release](https://github.com/SoftFever/OrcaSlicer/releases/latest)**
|
||||
Visit our GitHub Releases page for the latest stable version of Orca Slicer, recommended for most users.
|
||||
|
||||
### Nightly Builds
|
||||
🌙 **[Download the Latest Nightly Build](https://github.com/SoftFever/OrcaSlicer/releases/tag/nightly-builds)**
|
||||
Explore the latest developments in Orca Slicer with our nightly builds. Feedback on these versions is highly appreciated.
|
||||
|
||||
|
||||
# How to install
|
||||
**Windows**:
|
||||
1. Download the installer for your preferred version from the [releases page](https://github.com/SoftFever/OrcaSlicer/releases).
|
||||
- *For convenience there is also a portable build available.*
|
||||
- *If you have troubles to run the build, you might need to install following runtimes:*
|
||||
- [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/SoftFever/OrcaSlicer/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe)
|
||||
- [Details of this runtime](https://aka.ms/webview2)
|
||||
- [Alternative Download Link Hosted by Microsoft](https://go.microsoft.com/fwlink/p/?LinkId=2124703)
|
||||
- [vcredist2019_x64](https://github.com/SoftFever/OrcaSlicer/releases/download/v1.0.10-sf2/vcredist2019_x64.exe)
|
||||
- [Alternative Download Link Hosted by Microsoft](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||
- This file may already be available on your computer if you've installed visual studio. Check the following location: `%VCINSTALLDIR%Redist\MSVC\v142`
|
||||
|
||||
**Mac**:
|
||||
1. Download the DMG for your computer: `arm64` version for Apple Silicon and `x86_64` for Intel CPU.
|
||||
2. Drag OrcaSlicer.app to Application folder.
|
||||
3. *If you want to run a build from a PR, you also need to follow the instructions below:*
|
||||
<details quarantine>
|
||||
- Option 1 (You only need to do this once. After that the app can be opened normally.):
|
||||
- Step 1: Hold _cmd_ and right click the app, from the context menu choose **Open**.
|
||||
- Step 2: A warning window will pop up, click _Open_
|
||||
|
||||
- Option 2:
|
||||
Execute this command in terminal: `xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app`
|
||||
```console
|
||||
softfever@mac:~$ xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app
|
||||
```
|
||||
- Option 3:
|
||||
- Step 1: open the app, a warning window will pop up
|
||||

|
||||
- Step 2: in `System Settings` -> `Privacy & Security`, click `Open Anyway`:
|
||||

|
||||
</details>
|
||||
|
||||
**Linux (Ubuntu)**:
|
||||
1. If you run into trouble executing it, try this command in the terminal:
|
||||
`chmod +x /path_to_appimage/OrcaSlicer_Linux.AppImage`
|
||||
|
||||
# How to compile
|
||||
- Windows 64-bit
|
||||
- Tools needed: Visual Studio 2019, Cmake, git, git-lfs, Strawberry Perl.
|
||||
- You will require cmake version 3.14 or later, which is available [on their website](https://cmake.org/download/).
|
||||
- Strawberry Perl is [available on their GitHub repository](https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/).
|
||||
- Run `build_release.bat` in `x64 Native Tools Command Prompt for VS 2019`
|
||||
- Note: Don't forget to run `git lfs pull` after cloning the repository to download tools on Windows
|
||||
|
||||
- Mac 64-bit
|
||||
- Tools needed: Xcode, Cmake, git, gettext, libtool, automake, autoconf, texinfo
|
||||
- You can install most of them by running `brew install cmake gettext libtool automake autoconf texinfo`
|
||||
- run `build_release_macos.sh`
|
||||
- To build and debug in Xcode:
|
||||
- run `Xcode.app`
|
||||
- open ``build_`arch`/OrcaSlicer.Xcodeproj``
|
||||
- menu bar: Product => Scheme => OrcaSlicer
|
||||
- menu bar: Product => Scheme => Edit Scheme...
|
||||
- Run => Info tab => Build Configuration: `RelWithDebInfo`
|
||||
- Run => Options tab => Document Versions: uncheck `Allow debugging when browsing versions`
|
||||
- menu bar: Product => Run
|
||||
|
||||
- Linux (All Distros)
|
||||
- Docker
|
||||
- Dependencies: Docker [Installation Instructions](https://www.docker.com/get-started/), git
|
||||
- clone this repository `git clone https://github.com/SoftFever/OrcaSlicer`
|
||||
- run `cd OrcaSlicer`
|
||||
- run `./DockerBuild.sh`
|
||||
- To run OrcaSlicer:
|
||||
- run `./DockerRun.sh`
|
||||
- For most common errors, open `DockerRun.sh` and read the comments.
|
||||
- Ubuntu
|
||||
- Dependencies **Will be auto installed with the shell script**: `libmspack-dev libgstreamerd-3-dev libsecret-1-dev libwebkit2gtk-4.0-dev libosmesa6-dev libssl-dev libcurl4-openssl-dev eglexternalplatform-dev libudev-dev libdbus-1-dev extra-cmake-modules libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git texinfo`
|
||||
- run 'sudo ./BuildLinux.sh -u'
|
||||
- run './BuildLinux.sh -dsir'
|
||||
|
||||
# Note:
|
||||
If you're running Klipper, it's recommended to add the following configuration to your `printer.cfg` file.
|
||||
```
|
||||
# Enable object exclusion
|
||||
[exclude_object]
|
||||
|
||||
# Enable arcs support
|
||||
[gcode_arcs]
|
||||
resolution: 0.1
|
||||
```
|
||||
|
||||
# Supports
|
||||
**Orca Slicer** is an open-source project and I'm deeply grateful to all my sponsors and backers.
|
||||
Their generous support enables me to purchase filaments and other essential 3D printing materials for the project.
|
||||
Thank you! :)
|
||||
|
||||
### Sponsors:
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://qidi3d.com/">
|
||||
<img src="SoftFever_doc\sponsor_logos\QIDI.png" alt="QIDI" width="96" height="">
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://bigtree-tech.com/">
|
||||
<img src="SoftFever_doc\sponsor_logos\BigTreeTech.png" alt="BIGTREE TECH" width="96" height="">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Backers:
|
||||
**Ko-fi supporters**: [Backers list](https://github.com/user-attachments/files/16147016/Supporters_638561417699952499.csv)
|
||||
|
||||
## Support me
|
||||
<a href="https://github.com/sponsors/SoftFever"><img src="https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86" width="130"></a>
|
||||
|
||||
<a href="https://ko-fi.com/G2G5IP3CP"><img src="https://ko-fi.com/img/githubbutton_sm.svg" width="200"></a>
|
||||
|
||||
[](https://paypal.me/softfever3d)
|
||||
|
||||
|
||||
## Some background
|
||||
OrcaSlicer is originally forked from Bambu Studio, it was previously known as BambuStudio-SoftFever.
|
||||
|
||||
Bambu Studio is forked from [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, which is from [Slic3r](https://github.com/Slic3r/Slic3r) by Alessandro Ranellucci and the RepRap community.
|
||||
Orca Slicer incorporates a lot of features from SuperSlicer by @supermerill
|
||||
Orca Slicer's logo is designed by community member Justin Levine(@freejstnalxndr)
|
||||
Following platforms are currently supported to compile:
|
||||
- Windows 64-bit, [Compile Guide](https://github.com/bambulab/BambuStudio/wiki/Windows-Compile-Guide)
|
||||
- Mac 64-bit, [Compile Guide](https://github.com/bambulab/BambuStudio/wiki/Mac-Compile-Guide)
|
||||
|
||||
# Report issue
|
||||
You can add an issue to the [github tracker](https://github.com/bambulab/BambuStudio/issues) if **it isn't already present.**
|
||||
|
||||
# License
|
||||
Orca Slicer is licensed under the GNU Affero General Public License, version 3. Orca Slicer is based on Bambu Studio by BambuLab.
|
||||
|
||||
Bambu Studio is licensed under the GNU Affero General Public License, version 3. Bambu Studio is based on PrusaSlicer by PrusaResearch.
|
||||
|
||||
PrusaSlicer is licensed under the GNU Affero General Public License, version 3. PrusaSlicer is owned by Prusa Research. PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci.
|
||||
@@ -183,7 +76,5 @@ Slic3r is licensed under the GNU Affero General Public License, version 3. Slic3
|
||||
|
||||
The GNU Affero General Public License, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license.
|
||||
|
||||
Orca Slicer includes a pressure advance calibration pattern test adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3.
|
||||
|
||||
The Bambu networking plugin is based on non-free libraries from BambuLab. It is optional to the Orca Slicer and provides extended functionalities for Bambulab printer users.
|
||||
The BambuNetworking and BambuTunnel plugins are based on non-free libraries. They are optional to the Bambu Studio and provides extended functionalities for users.
|
||||
|
||||
|
||||
1
Readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
Init Version
|
||||
47
SECURITY.md
@@ -1,47 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
At OrcaSlicer, we are committed to maintaining the security of our ecosystem. Our policy is to ensure that we do not introduce vulnerabilities and that any security issues are addressed promptly and responsibly. We appreciate your help in improving the security of OrcaSlicer and thank you for your responsible disclosure.
|
||||
Reporting Security Bugs
|
||||
|
||||
## To report a security bug, please follow these guidelines:
|
||||
|
||||
* Email Security Bugs:
|
||||
Send an email to the lead maintainer at softfeverever@gmail.com.
|
||||
Include the word "SECURITY" in the subject line of your email.
|
||||
|
||||
* Response Times:
|
||||
The lead maintainer will acknowledge receipt of your email within one week (7 days).
|
||||
A detailed response will follow within 48 hours, outlining the next steps for handling your report.
|
||||
After the initial reply, the security team will keep you informed about the progress toward a fix and any announcements.
|
||||
|
||||
* Information and Collaboration:
|
||||
We may request additional information or guidance as we work on addressing the issue.
|
||||
|
||||
* Handling the Report:
|
||||
OrcaSlicer will confirm the problem and determine the affected versions.
|
||||
We will audit the code to find any similar issues and prepare fixes for all releases still under maintenance.
|
||||
Fixes will be released as quickly as possible.
|
||||
|
||||
* Third-Party Modules:
|
||||
Report security issues in third-party modules to the respective maintainer of those modules.
|
||||
|
||||
## Security Disclosure Guidelines
|
||||
|
||||
When disclosing a vulnerability, please follow these steps to ensure your report is clear and actionable:
|
||||
|
||||
* Provide Detailed Information:
|
||||
Scope: Clearly define the scope of the vulnerability.
|
||||
Potential Impact: Let us know who could be affected by this exploit.
|
||||
Reproduction Steps: Document detailed steps to reproduce the vulnerability.
|
||||
|
||||
Reference OWASP Guidelines:
|
||||
Follow the <a href="https://cheatsheetseries.owasp.org/cheatsheets/Vulnerability_Disclosure_Cheat_Sheet.html">OWASP Vulnerability Disclosure Cheat Sheet</a> for best practices in vulnerability disclosure.
|
||||
|
||||
## Security Recommendations
|
||||
|
||||
To enhance security when using OrcaSlicer, we recommend following these steps:
|
||||
|
||||
* SEE SOMETHING: If you notice anything suspicious or have concerns, please report it.
|
||||
* SAY SOMETHING: If you have any doubts or need assistance, do not hesitate to contact us.
|
||||
|
||||
### Thank you for your commitment to the security of OrcaSlicer. Your efforts help us maintain a safe and reliable ecosystem.
|
||||
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 131 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 211 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 729 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 353 KiB |
|
Before Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 305 KiB |
|
Before Width: | Height: | Size: 158 KiB |
5821
bbl/i18n/BambuStudio.pot
Normal file
17765
bbl/i18n/de/BambuStudio_de.po
Normal file
7090
bbl/i18n/en/BambuStudio_en.po
Normal file
17650
bbl/i18n/es/BambuStudio_es.po
Normal file
7479
bbl/i18n/fr/BambuStudio_fr.po
Normal file
109
bbl/i18n/list.txt
Normal file
@@ -0,0 +1,109 @@
|
||||
src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoFlatten.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoMove.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoScale.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmosManager.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp
|
||||
src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoFaceDetector.cpp
|
||||
src/slic3r/GUI/Gizmos/GLGizmoModifier.cpp
|
||||
src/slic3r/GUI/GUI.cpp
|
||||
src/slic3r/GUI/GUI_App.cpp
|
||||
src/slic3r/GUI/GUI_Init.cpp
|
||||
src/slic3r/GUI/GUI_Factories.cpp
|
||||
src/slic3r/GUI/GUI_ObjectList.cpp
|
||||
src/slic3r/GUI/GUI_ObjectSettings.cpp
|
||||
src/slic3r/GUI/GUI_ObjectTable.cpp
|
||||
src/slic3r/GUI/GUI_ObjectTable.hpp
|
||||
src/slic3r/GUI/GUI_ObjectTableSettings.cpp
|
||||
src/slic3r/GUI/GUI_ObjectTableSettings.hpp
|
||||
src/slic3r/GUI/GUI_Preview.cpp
|
||||
src/slic3r/GUI/Widgets/SideTools.cpp
|
||||
src/slic3r/GUI/Widgets/AMSControl.cpp
|
||||
src/slic3r/GUI/ImGuiWrapper.cpp
|
||||
src/slic3r/GUI/Jobs/ArrangeJob.cpp
|
||||
src/slic3r/GUI/Jobs/OrientJob.cpp
|
||||
src/slic3r/GUI/Jobs/FillBedJob.cpp
|
||||
src/slic3r/GUI/Jobs/Job.cpp
|
||||
src/slic3r/GUI/Jobs/PlaterJob.cpp
|
||||
src/slic3r/GUI/Jobs/RotoptimizeJob.cpp
|
||||
src/slic3r/GUI/Jobs/BindJob.cpp
|
||||
src/slic3r/GUI/Jobs/PrintJob.cpp
|
||||
src/slic3r/GUI/AboutDialog.cpp
|
||||
src/slic3r/GUI/AMSMaterialsSetting.cpp
|
||||
src/slic3r/GUI/AMSSetting.cpp
|
||||
src/slic3r/GUI/BBLTopbar.cpp
|
||||
src/slic3r/GUI/BackgroundSlicingProcess.cpp
|
||||
src/slic3r/GUI/BedShapeDialog.cpp
|
||||
src/slic3r/GUI/BedShapeDialog.hpp
|
||||
src/slic3r/GUI/ConfigManipulation.cpp
|
||||
src/slic3r/GUI/DeviceManager.cpp
|
||||
src/slic3r/GUI/ExtraRenderers.cpp
|
||||
src/slic3r/GUI/Field.cpp
|
||||
src/slic3r/GUI/GCodeViewer.cpp
|
||||
src/slic3r/GUI/GLCanvas3D.cpp
|
||||
src/slic3r/GUI/Calibration.cpp
|
||||
src/slic3r/GUI/CameraPopup.cpp
|
||||
src/slic3r/GUI/ConnectPrinter.cpp
|
||||
src/slic3r/GUI/DebugToolDialog.cpp
|
||||
src/slic3r/GUI/HMSPanel.cpp
|
||||
src/slic3r/GUI/MainFrame.cpp
|
||||
src/slic3r/GUI/MediaPlayCtrl.cpp
|
||||
src/slic3r/GUI/Mouse3DController.cpp
|
||||
src/slic3r/GUI/StatusPanel.cpp
|
||||
src/slic3r/GUI/Monitor.cpp
|
||||
src/slic3r/GUI/MsgDialog.cpp
|
||||
src/slic3r/GUI/NotificationManager.hpp
|
||||
src/slic3r/GUI/NotificationManager.cpp
|
||||
src/slic3r/GUI/ObjectDataViewModel.cpp
|
||||
src/slic3r/GUI/OpenGLManager.cpp
|
||||
src/slic3r/GUI/OptionsGroup.cpp
|
||||
src/slic3r/GUI/ParamsPanel.cpp
|
||||
src/slic3r/GUI/PartPlate.cpp
|
||||
src/slic3r/GUI/Plater.cpp
|
||||
src/slic3r/GUI/Preferences.cpp
|
||||
src/slic3r/GUI/PresetComboBoxes.cpp
|
||||
src/slic3r/GUI/PresetHints.cpp
|
||||
src/slic3r/GUI/ProgressStatusBar.cpp
|
||||
src/slic3r/GUI/PublishDialog.cpp
|
||||
src/slic3r/GUI/SavePresetDialog.cpp
|
||||
src/slic3r/GUI/Search.cpp
|
||||
src/slic3r/GUI/Selection.cpp
|
||||
src/slic3r/GUI/SelectMachine.cpp
|
||||
src/slic3r/GUI/SendSystemInfoDialog.cpp
|
||||
src/slic3r/GUI/BindDialog.cpp
|
||||
src/slic3r/GUI/Tab.cpp
|
||||
src/slic3r/GUI/Tab.hpp
|
||||
src/slic3r/GUI/UnsavedChangesDialog.cpp
|
||||
src/slic3r/GUI/Auxiliary.cpp
|
||||
src/slic3r/GUI/UpdateDialogs.cpp
|
||||
src/slic3r/GUI/WipeTowerDialog.cpp
|
||||
src/slic3r/GUI/wxExtensions.cpp
|
||||
src/slic3r/GUI/WebUserLoginDialog.cpp
|
||||
src/slic3r/GUI/WebGuideDialog.cpp
|
||||
src/slic3r/GUI/KBShortcutsDialog.hpp
|
||||
src/slic3r/GUI/KBShortcutsDialog.cpp
|
||||
src/slic3r/Utils/FixModelByWin10.cpp
|
||||
src/slic3r/Utils/PresetUpdater.cpp
|
||||
src/slic3r/Utils/Http.cpp
|
||||
src/slic3r/Utils/Process.cpp
|
||||
src/slic3r/GUI/Jobs/PrintJob.cpp
|
||||
src/libslic3r/GCode.cpp
|
||||
src/libslic3r/ExtrusionEntity.cpp
|
||||
src/libslic3r/Flow.cpp
|
||||
src/libslic3r/Format/AMF.cpp
|
||||
src/libslic3r/miniz_extension.cpp
|
||||
src/libslic3r/Preset.cpp
|
||||
src/libslic3r/Print.cpp
|
||||
src/libslic3r/PrintBase.cpp
|
||||
src/libslic3r/PrintConfig.cpp
|
||||
src/libslic3r/Zipper.cpp
|
||||
src/libslic3r/PrintObject.cpp
|
||||
src/libslic3r/PrintObjectSlice.cpp
|
||||
src/libslic3r/PlaceholderParser.cpp
|
||||
src/libslic3r/TreeSupport.cpp
|
||||
|
||||
7504
bbl/i18n/nl/BambuStudio_nl.po
Normal file
7322
bbl/i18n/sv/BambuStudio_sv.po
Normal file
9599
bbl/i18n/zh_cn/BambuStudio_zh_CN.po
Normal file
4
bbs_test_tools/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
# Add individual tools as executables in separate directories
|
||||
add_subdirectory(bbs_gcode_checker)
|
||||
|
||||
install(TARGETS bbs_gcode_checker RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
||||
6
bbs_test_tools/bbs_gcode_checker/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
cmake_minimum_required (VERSION 3.8)
|
||||
|
||||
project ("bbs_gcode_checker")
|
||||
|
||||
add_executable (bbs_gcode_checker "main.cpp" "GCodeChecker.cpp" "GCodeChecker.h" )
|
||||
|
||||
602
bbs_test_tools/bbs_gcode_checker/GCodeChecker.cpp
Normal file
@@ -0,0 +1,602 @@
|
||||
#include "GCodeChecker.h"
|
||||
#include <fstream>
|
||||
#include <math.h>
|
||||
#include <map>
|
||||
|
||||
namespace BambuStudio {
|
||||
|
||||
//BBS: only check wodth when dE is longer than this value
|
||||
const double CHECK_WIDTH_E_THRESHOLD = 0.0025;
|
||||
const double WIDTH_THRESHOLD = 0.012;
|
||||
const double RADIUS_THRESHOLD = 0.005;
|
||||
|
||||
const double filament_diameter = 1.75;
|
||||
const double Pi = 3.14159265358979323846;
|
||||
|
||||
const std::string Extrusion_Role_Tag = " FEATURE: ";
|
||||
const std::string Width_Tag = " LINE_WIDTH: ";
|
||||
const std::string Wipe_Start_Tag = " WIPE_START";
|
||||
const std::string Wipe_End_Tag = " WIPE_END";
|
||||
const std::string Layer_Change_Tag = " CHANGE_LAYER";
|
||||
const std::string Height_Tag = " LAYER_HEIGHT: ";
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_file(const std::string& path)
|
||||
{
|
||||
std::ifstream file(path);
|
||||
if (file.fail()) {
|
||||
std::cout << "Failed to open file " << path << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
std::string line_raw;
|
||||
std::string line;
|
||||
while (std::getline(file, line_raw)) {
|
||||
const char *c = line_raw.c_str();
|
||||
c = skip_whitespaces(c);
|
||||
if (std::toupper(*c) == 'N')
|
||||
c = skip_word(c);
|
||||
c = skip_whitespaces(c);
|
||||
line = c;
|
||||
if (parse_line(line) != GCodeCheckResult::Success) {
|
||||
std::cout << "Failed to parse line " << line_raw << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_layer_num == 0) {
|
||||
std::cout << "Invalid gcode file without layer change comment" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
bool GCodeChecker::include_chinese(const char* str)
|
||||
{
|
||||
char c;
|
||||
while(1)
|
||||
{
|
||||
c=*str++;
|
||||
if (is_end_of_line(c))
|
||||
break;
|
||||
if ((c & 0x80) && (*str & 0x80))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_line(const std::string& line)
|
||||
{
|
||||
// update start position
|
||||
m_start_position = m_end_position;
|
||||
|
||||
GCodeCheckResult ret;
|
||||
const char *c = skip_whitespaces(line.c_str());
|
||||
if (include_chinese(c)) {
|
||||
//chinese is forbidden
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
} if (is_end_of_line(*c)) {
|
||||
//BBS: skip empty line
|
||||
return GCodeCheckResult::Success;
|
||||
} else if (is_comment_line(*c)) {
|
||||
GCodeLine gcode_line;
|
||||
gcode_line.m_raw = c;
|
||||
ret = parse_comment(gcode_line);
|
||||
if (ret != GCodeCheckResult::Success)
|
||||
return ret;
|
||||
} else {
|
||||
GCodeLine gcode_line;
|
||||
gcode_line.m_raw = c;
|
||||
ret = parse_command(gcode_line);
|
||||
if (ret != GCodeCheckResult::Success)
|
||||
return ret;
|
||||
ret = check_line_width(gcode_line);
|
||||
if (ret != GCodeCheckResult::Success)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_comment(GCodeLine& line)
|
||||
{
|
||||
const char *c = line.m_raw.c_str();
|
||||
c++;
|
||||
std::string comment = c;
|
||||
// extrusion role tag
|
||||
if (starts_with(comment, Extrusion_Role_Tag)) {
|
||||
m_role = string_to_role(comment.substr(Extrusion_Role_Tag.length()));
|
||||
} else if (starts_with(comment, Wipe_Start_Tag)) {
|
||||
m_wiping = true;
|
||||
} else if (starts_with(comment, Wipe_End_Tag)) {
|
||||
m_wiping = false;
|
||||
} else if (starts_with(comment, Height_Tag)) {
|
||||
std::string str = comment.substr(Height_Tag.size());
|
||||
if (!parse_double_from_str(str, m_height)) {
|
||||
std::cout << "invalid height comment with invalid value!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
} else if (starts_with(comment, Width_Tag)) {
|
||||
std::string str = comment.substr(Width_Tag.size());
|
||||
if (!parse_double_from_str(str, m_width)) {
|
||||
std::cout << "invalid width comment with invalid value!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
} else if (starts_with(comment, Layer_Change_Tag)) {
|
||||
m_layer_num++;
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_command(GCodeLine& gcode_line)
|
||||
{
|
||||
const std::string cmd = gcode_line.cmd();
|
||||
GCodeCheckResult ret = GCodeCheckResult::Success;
|
||||
switch (::toupper(cmd[0])) {
|
||||
case 'G':
|
||||
{
|
||||
switch (::atoi(&cmd[1]))
|
||||
{
|
||||
case 0:
|
||||
case 1: { ret = parse_G0_G1(gcode_line); break; } // Move
|
||||
case 2:
|
||||
case 3: { ret = parse_G2_G3(gcode_line); break; } // Move
|
||||
case 90: { ret = parse_G90(gcode_line); break; } // Set to Absolute Positioning
|
||||
case 91: { ret = parse_G91(gcode_line); break; } // Set to Relative Positioning
|
||||
case 92: { ret = parse_G92(gcode_line); break; } // Set Position
|
||||
default: { break; }
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'M':{
|
||||
switch (::atoi(&cmd[1]))
|
||||
{
|
||||
case 82: { ret = parse_M82(gcode_line); break; } // Set to Absolute extrusion
|
||||
case 83: { ret = parse_M83(gcode_line); break; } // Set to Relative extrusion
|
||||
default: { break; }
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'T':{
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
//BBS: other g command? impossible! must be invalid
|
||||
ret = GCodeCheckResult::ParseFailed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_axis(GCodeLine& gcode_line)
|
||||
{
|
||||
const std::string cmd = gcode_line.m_raw;
|
||||
const char* c = cmd.c_str();
|
||||
c = skip_word(c);
|
||||
while (! is_end_of_gcode_line(*c)) {
|
||||
c = skip_whitespaces(c);
|
||||
if (is_end_of_gcode_line(*c))
|
||||
break;
|
||||
|
||||
Axis axis = UNKNOWN_AXIS;
|
||||
switch (*c) {
|
||||
case 'X': axis = X; break;
|
||||
case 'Y': axis = Y; break;
|
||||
case 'Z': axis = Z; break;
|
||||
case 'E': axis = E; break;
|
||||
case 'F': axis = F; break;
|
||||
case 'I': axis = I; break;
|
||||
case 'J': axis = J; break;
|
||||
default:
|
||||
//BBS: invalid command which has invalid axis
|
||||
std::cout << "Invalid gcode because of invalid axis!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
|
||||
char *pend = nullptr;
|
||||
double v = strtod(++c, &pend);
|
||||
if (pend != nullptr && is_end_of_word(*pend) && !isnan(v) && !isinf(v)) {
|
||||
gcode_line.m_axis[int(axis)] = v;
|
||||
if (gcode_line.m_mask & (1 << int(axis))) {
|
||||
//BBS: invalid command which has duplicated axis
|
||||
std::cout << "Invalid gcode because of duplicated axis!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
} else {
|
||||
gcode_line.m_mask |= 1 << int(axis);
|
||||
}
|
||||
if (c == pend) {
|
||||
//BBS: invalid command which has invalid axis value
|
||||
std::cout << "Invalid gcode because of invalid axis value!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
c = pend;
|
||||
} else {
|
||||
//BBS: invalid command for invalid axis value
|
||||
std::cout << "Invalid gcode because of invalid axis value!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_G0_G1(GCodeLine& gcode_line)
|
||||
{
|
||||
if (parse_axis(gcode_line) != GCodeCheckResult::Success)
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
|
||||
//BBS: invalid G1 command which has no axis or invalid axis
|
||||
if ((!gcode_line.m_mask) ||
|
||||
gcode_line.has(I) ||
|
||||
gcode_line.has(J)) {
|
||||
std::cout << "Invalid G0_G1 gcode because of no axis or invalid axis!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
|
||||
//BBS: invalid G1 command which has zero speed
|
||||
if (gcode_line.has(F) && gcode_line.get(F) == 0.0) {
|
||||
std::cout << "Invalid G0_G1 gcode because has F axis but 0 speed!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_G2_G3(GCodeLine& gcode_line)
|
||||
{
|
||||
if (parse_axis(gcode_line) != GCodeCheckResult::Success)
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
|
||||
//BBS: invalid G2_G3 command which has no axis or Z axis
|
||||
if (!gcode_line.m_mask) {
|
||||
std::cout << "Invalid G2_G3 gcode because of no axis or has Z axis!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
//BBS: invalid G2_G3 command which has zero speed
|
||||
if (gcode_line.has(F) && gcode_line.get(F) == 0.0) {
|
||||
std::cout << "Invalid G2_G3 gcode because has F axis but 0 speed!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
//BBS: invalid G2_G3 command which has no I and J axis
|
||||
if (!gcode_line.has(I) &&
|
||||
!gcode_line.has(J)) {
|
||||
std::cout << "Invalid G2_G3 gcode because of no I and J axis at same time!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
//BBS: invalid G2_G3 command which has no X and Y axis at same time
|
||||
if (!gcode_line.has(X) &&
|
||||
!gcode_line.has(Y)) {
|
||||
if (!gcode_line.has(X) || !gcode_line.has(P) || (int)gcode_line.get(P) != 1) {
|
||||
std::cout << "Invalid G2_G3 gcode because of no X and Y axis at same time!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_G90(const GCodeLine& gcode_line)
|
||||
{
|
||||
const char* c = gcode_line.m_raw.c_str();
|
||||
//BBS: G90 is single command with no argument
|
||||
if (!is_single_gcode_word(c)) {
|
||||
std::cout << "Invalid G90 gcode with invalid end!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
m_global_positioning_type = EPositioningType::Absolute;
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_G91(const GCodeLine& gcode_line)
|
||||
{
|
||||
const char* c = gcode_line.m_raw.c_str();
|
||||
//BBS: G91 is single command with no argument
|
||||
if (!is_single_gcode_word(c)) {
|
||||
std::cout << "Invalid G91 gcode with invalid end!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
m_global_positioning_type = EPositioningType::Relative;
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_G92(GCodeLine& gcode_line)
|
||||
{
|
||||
if (parse_axis(gcode_line) != GCodeCheckResult::Success)
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
|
||||
//BBS: invalid G92 command which has no axis or invalid axis
|
||||
if (!gcode_line.m_mask ||
|
||||
gcode_line.has(F) ||
|
||||
gcode_line.has(I) ||
|
||||
gcode_line.has(J)) {
|
||||
std::cout << "Invalid G2_G3 gcode because of no axis or invalid axis!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
|
||||
if (gcode_line.has(X))
|
||||
m_origin[X] = m_end_position[X] - gcode_line.get(X);
|
||||
|
||||
if (gcode_line.has(Y))
|
||||
m_origin[Y] = m_end_position[Y] - gcode_line.get(Y);
|
||||
|
||||
if (gcode_line.has(Z))
|
||||
m_origin[Z] = m_end_position[Z] - gcode_line.get(Z);
|
||||
|
||||
if (gcode_line.has(E))
|
||||
m_end_position[E] = gcode_line.get(E);
|
||||
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
m_origin[a] = m_end_position[a];
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_M82(const GCodeLine& gcode_line)
|
||||
{
|
||||
const char* c = gcode_line.m_raw.c_str();
|
||||
//BBS: M82 is single command with no argument
|
||||
if (!is_single_gcode_word(c)) {
|
||||
std::cout << "Invalid M82 gcode with invalid end!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
m_e_local_positioning_type = EPositioningType::Absolute;
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::parse_M83(const GCodeLine& gcode_line)
|
||||
{
|
||||
const char* c = gcode_line.m_raw.c_str();
|
||||
//BBS: M83 is single command with no argument
|
||||
if (!is_single_gcode_word(c)) {
|
||||
std::cout << "Invalid M83 gcode with invalid end!" << std::endl;
|
||||
return GCodeCheckResult::ParseFailed;
|
||||
}
|
||||
m_e_local_positioning_type = EPositioningType::Relative;
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
double GCodeChecker::calculate_G1_width(const std::array<double, 3>& source,
|
||||
const std::array<double, 3>& target,
|
||||
double e, double height, bool is_bridge) const
|
||||
{
|
||||
double volume = e * Pi * (filament_diameter/2.0f) * (filament_diameter/2.0f);
|
||||
std::array<double, 3> delta = { target[0] - source[0],
|
||||
target[1] - source[1],
|
||||
target[2] - source[2] };
|
||||
double length = sqrt(delta[0] * delta[0] + delta[1] * delta[1] + delta[2] * delta[2]);
|
||||
double mm3_per_mm = volume / length;
|
||||
return is_bridge? 2 * sqrt(mm3_per_mm/Pi) :
|
||||
(mm3_per_mm / height) + height * (1 - 0.25 * Pi);
|
||||
}
|
||||
|
||||
double GCodeChecker::calculate_G2_G3_width(const std::array<double, 2>& source,
|
||||
const std::array<double, 2>& target,
|
||||
const std::array<double, 2>& center,
|
||||
bool is_ccw, double e, double height,
|
||||
bool is_bridge) const
|
||||
{
|
||||
std::array<double, 2> v1 = { source[0] - center[0], source[1] - center[1] };
|
||||
std::array<double, 2> v2 = { target[0] - center[0], target[1] - center[1] };
|
||||
|
||||
double dot = v1[0] * v2[0] + v1[1] * v2[1];
|
||||
double cross = v1[0] * v2[1] - v1[1] * v2[0];
|
||||
double radian = atan2(cross, dot);
|
||||
radian = is_ccw ?
|
||||
(radian < 0 ? 2 * Pi + radian : radian) :
|
||||
(radian < 0 ? -radian : 2 * Pi - radian);
|
||||
double radius = sqrt(v1[0] * v1[0] + v1[1] * v1[1]);
|
||||
double length = radius * radian;
|
||||
double volume = e * Pi * (filament_diameter/2) * (filament_diameter/2);
|
||||
double mm3_per_mm = volume / length;
|
||||
return is_bridge? 2 * sqrt(mm3_per_mm/Pi) :
|
||||
(mm3_per_mm / height) + height * (1 - 0.25 * Pi);
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::check_line_width(const GCodeLine& gcode_line)
|
||||
{
|
||||
//BBS: don't need to check extrusion before first layer
|
||||
if (m_layer_num <= 0) {
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult ret = GCodeCheckResult::Success;
|
||||
//BBS: only need to handle G0 G1 G2 G3
|
||||
const std::string cmd = gcode_line.cmd();
|
||||
int cmd_id = ::atoi(&cmd[1]);
|
||||
if (::toupper(cmd[0]) == 'G')
|
||||
switch (::atoi(&cmd[1]))
|
||||
{
|
||||
case 0:
|
||||
case 1: { ret = check_G0_G1_width(gcode_line); break; }
|
||||
case 2:
|
||||
case 3: { ret = check_G2_G3_width(gcode_line); break; }
|
||||
default: { break; }
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::check_G0_G1_width(const GCodeLine& line)
|
||||
{
|
||||
auto absolute_position = [this](Axis axis, const GCodeLine& lineG1) {
|
||||
bool is_relative = (m_global_positioning_type == EPositioningType::Relative);
|
||||
if (axis == E)
|
||||
is_relative |= (m_e_local_positioning_type == EPositioningType::Relative);
|
||||
|
||||
if (lineG1.has(Axis(axis))) {
|
||||
double ret = lineG1.get(Axis(axis));
|
||||
return is_relative ? m_start_position[axis] + ret : m_origin[axis] + ret;
|
||||
} else
|
||||
return m_start_position[axis];
|
||||
};
|
||||
|
||||
auto move_type = [this](const std::array<double, 4>& delta_pos) {
|
||||
EMoveType type = EMoveType::Noop;
|
||||
|
||||
if (m_wiping)
|
||||
type = EMoveType::Wipe;
|
||||
else if (delta_pos[E] < 0.0f)
|
||||
type = (delta_pos[X] != 0.0f || delta_pos[Y] != 0.0f || delta_pos[Z] != 0.0f) ? EMoveType::Travel : EMoveType::Retract;
|
||||
else if (delta_pos[E] > 0.0f) {
|
||||
if (delta_pos[X] == 0.0f && delta_pos[Y] == 0.0f)
|
||||
type = (delta_pos[Z] == 0.0f) ? EMoveType::Unretract : EMoveType::Travel;
|
||||
else if (delta_pos[X] != 0.0f || delta_pos[Y] != 0.0f)
|
||||
type = EMoveType::Extrude;
|
||||
}
|
||||
else if (delta_pos[X] != 0.0f || delta_pos[Y] != 0.0f || delta_pos[Z] != 0.0f)
|
||||
type = EMoveType::Travel;
|
||||
|
||||
return type;
|
||||
};
|
||||
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
m_end_position[a] = absolute_position((Axis)a, line);
|
||||
}
|
||||
|
||||
// calculates movement deltas
|
||||
std::array<double, 4> delta_pos;
|
||||
for (unsigned char a = X; a <= E; ++a)
|
||||
delta_pos[a] = m_end_position[a] - m_start_position[a];
|
||||
|
||||
// Todo: currently, for precision, there alwasy has possible to generate
|
||||
// such gcode because of decimal truncation
|
||||
/*if (line.has(Axis(E)) && delta_pos[E] == 0.0 && !m_wiping) {
|
||||
std::cout << "Invalid GCode because has E axis but 0 extrusion" << std::endl;
|
||||
return GCodeCheckResult::CheckFailed;
|
||||
}*/
|
||||
|
||||
EMoveType type = move_type(delta_pos);
|
||||
if (type == EMoveType::Extrude && m_end_position[Z] == 0.0f)
|
||||
type = EMoveType::Travel;
|
||||
|
||||
//BBS: calculate line width and compare.
|
||||
//Don't need to check gap fill which has verious width
|
||||
if (type == EMoveType::Extrude &&
|
||||
m_role != erGapFill &&
|
||||
delta_pos[E] > CHECK_WIDTH_E_THRESHOLD) {
|
||||
std::array<double, 3> source = { m_start_position[X], m_start_position[Y], m_start_position[Z] };
|
||||
std::array<double, 3> target = { m_end_position[X], m_end_position[Y], m_end_position[Z] };
|
||||
|
||||
bool is_bridge = m_role == erOverhangPerimeter || m_role == erBridgeInfill;
|
||||
double width_real = calculate_G1_width(source, target, delta_pos[E], m_height, is_bridge);
|
||||
if (fabs(width_real - m_width) > WIDTH_THRESHOLD) {
|
||||
std::cout << "Invalid G0_G1 because has abnormal line width." << std::endl;
|
||||
std::cout << "Width: " << m_width << " Width_real: " << width_real << std::endl;
|
||||
return GCodeCheckResult::CheckFailed;
|
||||
}
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
GCodeCheckResult GCodeChecker::check_G2_G3_width(const GCodeLine& line)
|
||||
{
|
||||
auto absolute_position = [this](Axis axis, const GCodeLine& lineG2_3) {
|
||||
bool is_relative = (m_global_positioning_type == EPositioningType::Relative);
|
||||
if (axis == E)
|
||||
is_relative |= (m_e_local_positioning_type == EPositioningType::Relative);
|
||||
|
||||
if (lineG2_3.has(Axis(axis))) {
|
||||
double ret = lineG2_3.get(Axis(axis));
|
||||
if (axis == I)
|
||||
return m_start_position[X] + ret;
|
||||
else if (axis == J)
|
||||
return m_start_position[Y] + ret;
|
||||
else
|
||||
return is_relative ? m_start_position[axis] + ret : m_origin[axis] + ret;
|
||||
} else {
|
||||
if (axis == I)
|
||||
return m_start_position[X];
|
||||
else if (axis == J)
|
||||
return m_start_position[Y];
|
||||
else
|
||||
return m_start_position[axis];
|
||||
}
|
||||
};
|
||||
|
||||
auto move_type = [this](const double& delta_E) {
|
||||
EMoveType type = EMoveType::Noop;
|
||||
|
||||
if (m_wiping)
|
||||
type = EMoveType::Wipe;
|
||||
else if (delta_E < 0.0f || delta_E == 0.0f)
|
||||
type = EMoveType::Travel;
|
||||
else
|
||||
type = EMoveType::Extrude;
|
||||
|
||||
return type;
|
||||
};
|
||||
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
m_end_position[a] = absolute_position((Axis)a, line);
|
||||
}
|
||||
std::array<double, 2> source = { m_start_position[X], m_start_position[Y] };
|
||||
std::array<double, 2> target = { m_end_position[X], m_end_position[Y] };
|
||||
std::array<double, 2> center = { absolute_position(I, line),absolute_position(J, line) };
|
||||
const std::string& cmd = line.cmd();
|
||||
bool is_ccw = (::atoi(&cmd[1]) == 2) ? false : true;
|
||||
double delta_e = m_end_position[E] - m_start_position[E];
|
||||
EMoveType type = move_type(delta_e);
|
||||
|
||||
//BBS: judge whether is normal arc by radius
|
||||
double radius1 = sqrt(pow((source[0] - center[0]), 2) + pow((source[1] - center[1]), 2));
|
||||
double radius2 = sqrt(pow((target[0] - center[0]), 2) + pow((target[1] - center[1]), 2));
|
||||
if (fabs(radius2 - radius1) > RADIUS_THRESHOLD) {
|
||||
std::cout << "Invalid G2_G3 because of abnormal radius." << std::endl;
|
||||
std::cout << "radius1: " << radius1 << " radius2: " << radius2 << std::endl;
|
||||
return GCodeCheckResult::CheckFailed;
|
||||
}
|
||||
|
||||
//BBS: calculate line width and compare
|
||||
//Don't need to check gap fill which has verious width
|
||||
if (type == EMoveType::Extrude &&
|
||||
m_role != erGapFill &&
|
||||
delta_e > CHECK_WIDTH_E_THRESHOLD) {
|
||||
bool is_bridge = m_role == erOverhangPerimeter || m_role == erBridgeInfill;
|
||||
double width_real = calculate_G2_G3_width(source, target, center, is_ccw, delta_e, m_height, is_bridge);
|
||||
if (fabs(width_real - m_width) > WIDTH_THRESHOLD) {
|
||||
std::cout << "Invalid G2_G3 because has abnormal line width." << std::endl;
|
||||
std::cout << "Width: " << m_width << " Width_real: " << width_real << std::endl;
|
||||
return GCodeCheckResult::CheckFailed;
|
||||
}
|
||||
}
|
||||
|
||||
return GCodeCheckResult::Success;
|
||||
}
|
||||
|
||||
const std::map<std::string, ExtrusionRole> string_to_role_map = {
|
||||
{ "Inner wall", erPerimeter },
|
||||
{ "Outer wall", erExternalPerimeter },
|
||||
{ "Overhang wall", erOverhangPerimeter },
|
||||
{ "Sparse infill", erInternalInfill },
|
||||
{ "Internal solid infill", erSolidInfill },
|
||||
{ "Top surface", erTopSolidInfill },
|
||||
{ "Bottom surface", erBottomSurface },
|
||||
{ "Ironing", erIroning },
|
||||
{ "Bridge", erBridgeInfill },
|
||||
{ "Gap infill", erGapFill },
|
||||
{ "Skirt", erSkirt },
|
||||
{ "Brim", erBrim },
|
||||
{ "Support", erSupportMaterial },
|
||||
{ "Support interface", erSupportMaterialInterface },
|
||||
{ "Support transition", erSupportTransition },
|
||||
{ "Prime tower", erWipeTower },
|
||||
{ "Custom", erCustom },
|
||||
{ "Mixed", erMixed }
|
||||
};
|
||||
|
||||
ExtrusionRole GCodeChecker::string_to_role(const std::string &role)
|
||||
{
|
||||
for (auto it = string_to_role_map.begin(); it != string_to_role_map.end(); it++) {
|
||||
if (role == it->first)
|
||||
return it->second;
|
||||
}
|
||||
return erNone;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
181
bbs_test_tools/bbs_gcode_checker/GCodeChecker.h
Normal file
@@ -0,0 +1,181 @@
|
||||
#ifndef _GCodeChecker_H_
|
||||
#define _GCodeChecker_H_
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
||||
namespace BambuStudio {
|
||||
|
||||
enum class GCodeCheckResult : unsigned char
|
||||
{
|
||||
Success,
|
||||
ParseFailed,
|
||||
CheckFailed,
|
||||
Count
|
||||
};
|
||||
|
||||
enum class EMoveType : unsigned char
|
||||
{
|
||||
Noop,
|
||||
Retract,
|
||||
Unretract,
|
||||
Tool_change,
|
||||
Color_change,
|
||||
Pause_Print,
|
||||
Custom_GCode,
|
||||
Travel,
|
||||
Wipe,
|
||||
Extrude,
|
||||
Count
|
||||
};
|
||||
|
||||
enum Axis {
|
||||
X=0,
|
||||
Y,
|
||||
Z,
|
||||
E,
|
||||
F,
|
||||
I,
|
||||
J,
|
||||
P,
|
||||
NUM_AXES,
|
||||
UNKNOWN_AXIS = NUM_AXES,
|
||||
};
|
||||
|
||||
enum ExtrusionRole : uint8_t {
|
||||
erNone,
|
||||
erPerimeter,
|
||||
erExternalPerimeter,
|
||||
erOverhangPerimeter,
|
||||
erInternalInfill,
|
||||
erSolidInfill,
|
||||
erTopSolidInfill,
|
||||
erBottomSurface,
|
||||
erIroning,
|
||||
erBridgeInfill,
|
||||
erGapFill,
|
||||
erSkirt,
|
||||
erBrim,
|
||||
erSupportMaterial,
|
||||
erSupportMaterialInterface,
|
||||
erSupportTransition,
|
||||
erWipeTower,
|
||||
erCustom,
|
||||
// Extrusion role for a collection with multiple extrusion roles.
|
||||
erMixed,
|
||||
erCount
|
||||
};
|
||||
|
||||
class GCodeChecker {
|
||||
public:
|
||||
class GCodeLine {
|
||||
public:
|
||||
GCodeLine() {}
|
||||
const std::string cmd() const {
|
||||
const char *cmd = GCodeChecker::skip_whitespaces(m_raw.c_str());
|
||||
return std::string(cmd, GCodeChecker::skip_word(cmd) - cmd);
|
||||
}
|
||||
|
||||
bool has(Axis axis) const { return (m_mask & (1 << int(axis))) != 0; }
|
||||
double get(Axis axis) const { return m_axis[int(axis)]; }
|
||||
|
||||
std::string m_raw;
|
||||
double m_axis[NUM_AXES] = { 0.0f };
|
||||
uint32_t m_mask = 0;
|
||||
};
|
||||
|
||||
enum class EPositioningType : unsigned char
|
||||
{
|
||||
Absolute,
|
||||
Relative
|
||||
};
|
||||
|
||||
GCodeChecker() {}
|
||||
GCodeCheckResult parse_file(const std::string& path);
|
||||
|
||||
private:
|
||||
bool include_chinese(const char* str);
|
||||
GCodeCheckResult parse_line(const std::string& line);
|
||||
|
||||
GCodeCheckResult parse_command(GCodeLine& gcode_line);
|
||||
GCodeCheckResult parse_axis(GCodeLine& gcode_line);
|
||||
GCodeCheckResult parse_G0_G1(GCodeLine& gcode_line);
|
||||
GCodeCheckResult parse_G2_G3(GCodeLine& gcode_line);
|
||||
GCodeCheckResult parse_G90(const GCodeLine& gcode_line);
|
||||
GCodeCheckResult parse_G91(const GCodeLine& gcode_line);
|
||||
GCodeCheckResult parse_G92(GCodeLine& gcode_line);
|
||||
GCodeCheckResult parse_M82(const GCodeLine& gcode_line);
|
||||
GCodeCheckResult parse_M83(const GCodeLine& gcode_line);
|
||||
|
||||
GCodeCheckResult parse_comment(GCodeLine& gcode_line);
|
||||
|
||||
GCodeCheckResult check_line_width(const GCodeLine& gcode_line);
|
||||
GCodeCheckResult check_G0_G1_width(const GCodeLine& gcode_line);
|
||||
GCodeCheckResult check_G2_G3_width(const GCodeLine& gcode_line);
|
||||
|
||||
double calculate_G1_width(const std::array<double, 3>& source,
|
||||
const std::array<double, 3>& target,
|
||||
double e, double height, bool is_bridge) const;
|
||||
double calculate_G2_G3_width(const std::array<double, 2>& source,
|
||||
const std::array<double, 2>& target,
|
||||
const std::array<double, 2>& center,
|
||||
bool is_ccw, double e, double height, bool is_bridge) const;
|
||||
|
||||
public:
|
||||
static bool is_whitespace(char c) { return c == ' ' || c == '\t'; }
|
||||
static bool is_end_of_line(char c) { return c == '\r' || c == '\n' || c == 0; }
|
||||
static bool is_comment_line(char c) { return c == ';'; }
|
||||
static bool is_end_of_gcode_line(char c) { return is_comment_line(c) || is_end_of_line(c); }
|
||||
static bool is_end_of_word(char c) { return is_whitespace(c) || is_end_of_gcode_line(c); }
|
||||
static const char* skip_word(const char *c) {
|
||||
for (; ! is_end_of_word(*c); ++ c)
|
||||
; // silence -Wempty-body
|
||||
return c;
|
||||
}
|
||||
static const char* skip_whitespaces(const char *c) {
|
||||
for (; is_whitespace(*c); ++ c)
|
||||
; // silence -Wempty-body
|
||||
return c;
|
||||
}
|
||||
static bool is_single_gcode_word(const char* c) {
|
||||
c = skip_word(c);
|
||||
c = skip_whitespaces(c);
|
||||
return is_end_of_gcode_line(*c);
|
||||
}
|
||||
static bool starts_with(const std::string &comment, const std::string &tag) {
|
||||
size_t tag_len = tag.size();
|
||||
return comment.size() >= tag_len && comment.substr(0, tag_len) == tag;
|
||||
}
|
||||
static ExtrusionRole string_to_role(const std::string& role);
|
||||
//BBS: Returns true if the number was parsed correctly into out and the number spanned the whole input string.
|
||||
static bool parse_double_from_str(const std::string& input, double& out) {
|
||||
size_t read = 0;
|
||||
try {
|
||||
out = std::stod(input, &read);
|
||||
return input.size() == read;
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EPositioningType m_global_positioning_type = EPositioningType::Absolute;
|
||||
EPositioningType m_e_local_positioning_type = EPositioningType::Absolute;
|
||||
|
||||
std::array<double, 4> m_start_position = { 0.0, 0.0, 0.0, 0.0 };
|
||||
std::array<double, 4> m_end_position = { 0.0, 0.0, 0.0, 0.0 };
|
||||
std::array<double, 4> m_origin = { 0.0, 0.0, 0.0, 0.0 };
|
||||
|
||||
//BBS: use these value to save information from comment
|
||||
ExtrusionRole m_role = erNone;
|
||||
bool m_wiping = false;
|
||||
int m_layer_num = 0;
|
||||
double m_height = 0.0;
|
||||
double m_width = 0.0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
24
bbs_test_tools/bbs_gcode_checker/main.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "GCodeChecker.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace BambuStudio;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
cout << "Invalid input arguments" << endl;
|
||||
return -1;
|
||||
}
|
||||
string path(argv[1]);
|
||||
cout << "Start to check file " << path << endl;
|
||||
GCodeChecker checker;
|
||||
|
||||
//BBS: parse and check whether has invalid gcode
|
||||
if (checker.parse_file(path) != GCodeCheckResult::Success) {
|
||||
cout << "Failed to parse and check file " << path << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
cout << "Success to parse and check file" << path << endl;
|
||||
return 0;
|
||||
}
|
||||
@@ -1,50 +1,14 @@
|
||||
set WP=%CD%
|
||||
|
||||
set debug=OFF
|
||||
set debuginfo=OFF
|
||||
if "%1"=="debug" set debug=ON
|
||||
if "%2"=="debug" set debug=ON
|
||||
if "%1"=="debuginfo" set debuginfo=ON
|
||||
if "%2"=="debuginfo" set debuginfo=ON
|
||||
if "%debug%"=="ON" (
|
||||
set build_type=Debug
|
||||
set build_dir=build-dbg
|
||||
) else (
|
||||
if "%debuginfo%"=="ON" (
|
||||
set build_type=RelWithDebInfo
|
||||
set build_dir=build-dbginfo
|
||||
) else (
|
||||
set build_type=Release
|
||||
set build_dir=build
|
||||
)
|
||||
)
|
||||
echo build type set to %build_type%
|
||||
|
||||
cd deps
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
set DEPS=%CD%/OrcaSlicer_dep
|
||||
if "%1"=="slicer" (
|
||||
GOTO :slicer
|
||||
)
|
||||
echo "building deps.."
|
||||
mkdir build
|
||||
cd build
|
||||
set DEPS=%CD%/BambuStudio_dep
|
||||
cmake ../ -G "Visual Studio 16 2019" -DDESTDIR="%CD%/BambuStudio_dep" -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . --config Release --target ALL_BUILD -- -m
|
||||
|
||||
echo cmake ../ -G "Visual Studio 16 2019" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo%
|
||||
cmake ../ -G "Visual Studio 16 2019" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo%
|
||||
cmake --build . --config %build_type% --target deps -- -m
|
||||
|
||||
if "%1"=="deps" exit /b 0
|
||||
|
||||
:slicer
|
||||
echo "building Orca Slicer..."
|
||||
cd %WP%
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
|
||||
echo cmake .. -G "Visual Studio 16 2019" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake .. -G "Visual Studio 16 2019" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0"
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
cd ..
|
||||
call run_gettext.bat
|
||||
cd %build_dir%
|
||||
cmake --build . --target install --config %build_type%
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Visual Studio 16 2019" -DBBL_RELEASE_TO_PUBLIC=0 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./BambuStudio-SoftFever" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0"
|
||||
cmake --build . --config Release --target ALL_BUILD -- -m
|
||||
cmake --build . --target install --config Release
|
||||
@@ -1,294 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
while getopts ":dpa:snt:xbc:hu" opt; do
|
||||
case "${opt}" in
|
||||
d )
|
||||
export BUILD_TARGET="deps"
|
||||
;;
|
||||
p )
|
||||
export PACK_DEPS="1"
|
||||
;;
|
||||
a )
|
||||
export ARCH="$OPTARG"
|
||||
;;
|
||||
s )
|
||||
export BUILD_TARGET="slicer"
|
||||
;;
|
||||
n )
|
||||
export NIGHTLY_BUILD="1"
|
||||
;;
|
||||
t )
|
||||
export OSX_DEPLOYMENT_TARGET="$OPTARG"
|
||||
;;
|
||||
x )
|
||||
export SLICER_CMAKE_GENERATOR="Ninja"
|
||||
export SLICER_BUILD_TARGET="all"
|
||||
export DEPS_CMAKE_GENERATOR="Ninja"
|
||||
;;
|
||||
b )
|
||||
export BUILD_ONLY="1"
|
||||
;;
|
||||
c )
|
||||
export BUILD_CONFIG="$OPTARG"
|
||||
;;
|
||||
1 )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=1
|
||||
;;
|
||||
u )
|
||||
export BUILD_UNIVERSAL="1"
|
||||
;;
|
||||
h ) echo "Usage: ./build_release_macos.sh [-d]"
|
||||
echo " -d: Build deps only"
|
||||
echo " -a: Set ARCHITECTURE (arm64 or x86_64)"
|
||||
echo " -s: Build slicer only"
|
||||
echo " -n: Nightly build"
|
||||
echo " -t: Specify minimum version of the target platform, default is 11.3"
|
||||
echo " -x: Use Ninja CMake generator, default is Xcode"
|
||||
echo " -b: Build without reconfiguring CMake"
|
||||
echo " -c: Set CMake build configuration, default is Release"
|
||||
echo " -u: Build universal binary (both arm64 and x86_64)"
|
||||
echo " -1: Use single job for building"
|
||||
exit 0
|
||||
;;
|
||||
* )
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Set defaults
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
if [ "1." == "$BUILD_UNIVERSAL". ]; then
|
||||
ARCH="universal"
|
||||
else
|
||||
ARCH="$(uname -m)"
|
||||
fi
|
||||
export ARCH
|
||||
fi
|
||||
|
||||
if [ "1." == "$BUILD_UNIVERSAL". ]; then
|
||||
echo "Universal build enabled - will create a combined arm64/x86_64 binary"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_CONFIG" ]; then
|
||||
export BUILD_CONFIG="Release"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_TARGET" ]; then
|
||||
export BUILD_TARGET="all"
|
||||
fi
|
||||
|
||||
if [ -z "$SLICER_CMAKE_GENERATOR" ]; then
|
||||
export SLICER_CMAKE_GENERATOR="Xcode"
|
||||
fi
|
||||
|
||||
if [ -z "$SLICER_BUILD_TARGET" ]; then
|
||||
export SLICER_BUILD_TARGET="ALL_BUILD"
|
||||
fi
|
||||
|
||||
if [ -z "$DEPS_CMAKE_GENERATOR" ]; then
|
||||
export DEPS_CMAKE_GENERATOR="Unix Makefiles"
|
||||
fi
|
||||
|
||||
if [ -z "$OSX_DEPLOYMENT_TARGET" ]; then
|
||||
export OSX_DEPLOYMENT_TARGET="11.3"
|
||||
fi
|
||||
|
||||
echo "Build params:"
|
||||
echo " - ARCH: $ARCH"
|
||||
echo " - BUILD_CONFIG: $BUILD_CONFIG"
|
||||
echo " - BUILD_TARGET: $BUILD_TARGET"
|
||||
echo " - CMAKE_GENERATOR: $SLICER_CMAKE_GENERATOR for Slicer, $DEPS_CMAKE_GENERATOR for deps"
|
||||
echo " - OSX_DEPLOYMENT_TARGET: $OSX_DEPLOYMENT_TARGET"
|
||||
echo
|
||||
|
||||
# if which -s brew; then
|
||||
# brew --prefix libiconv
|
||||
# brew --prefix zstd
|
||||
# export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/
|
||||
# elif which -s port; then
|
||||
# port install libiconv
|
||||
# port install zstd
|
||||
# export LIBRARY_PATH=$LIBRARY_PATH:/opt/local/lib
|
||||
# else
|
||||
# echo "Need either brew or macports to successfully build deps"
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build_$ARCH"
|
||||
DEPS_DIR="$PROJECT_DIR/deps"
|
||||
DEPS_BUILD_DIR="$DEPS_DIR/build_$ARCH"
|
||||
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep_$ARCH"
|
||||
|
||||
# Fix for Multi-config generators
|
||||
if [ "$SLICER_CMAKE_GENERATOR" == "Xcode" ]; then
|
||||
export BUILD_DIR_CONFIG_SUBDIR="/$BUILD_CONFIG"
|
||||
else
|
||||
export BUILD_DIR_CONFIG_SUBDIR=""
|
||||
fi
|
||||
|
||||
function build_deps() {
|
||||
echo "Building deps..."
|
||||
(
|
||||
set -x
|
||||
mkdir -p "$DEPS"
|
||||
cd "$DEPS_BUILD_DIR"
|
||||
if [ "1." != "$BUILD_ONLY". ]; then
|
||||
cmake .. \
|
||||
-G "${DEPS_CMAKE_GENERATOR}" \
|
||||
-DDESTDIR="$DEPS" \
|
||||
-DOPENSSL_ARCH="darwin64-${ARCH}-cc" \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
|
||||
-DCMAKE_OSX_ARCHITECTURES:STRING="${ARCH}" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}"
|
||||
fi
|
||||
cmake --build . --config "$BUILD_CONFIG" --target deps
|
||||
)
|
||||
}
|
||||
|
||||
function pack_deps() {
|
||||
echo "Packing deps..."
|
||||
(
|
||||
set -x
|
||||
mkdir -p "$DEPS"
|
||||
cd "$DEPS_BUILD_DIR"
|
||||
tar -zcvf "OrcaSlicer_dep_mac_${ARCH}_$(date +"%Y%m%d").tar.gz" "OrcaSlicer_dep_$ARCH"
|
||||
)
|
||||
}
|
||||
|
||||
function build_slicer() {
|
||||
echo "Building slicer..."
|
||||
(
|
||||
set -x
|
||||
mkdir -p "$PROJECT_BUILD_DIR"
|
||||
cd "$PROJECT_BUILD_DIR"
|
||||
if [ "1." != "$BUILD_ONLY". ]; then
|
||||
cmake .. \
|
||||
-G "${SLICER_CMAKE_GENERATOR}" \
|
||||
-DBBL_RELEASE_TO_PUBLIC=1 \
|
||||
-DCMAKE_PREFIX_PATH="$DEPS/usr/local" \
|
||||
-DCMAKE_INSTALL_PREFIX="$PWD/OrcaSlicer" \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
|
||||
-DCMAKE_MACOSX_RPATH=ON \
|
||||
-DCMAKE_INSTALL_RPATH="${DEPS}/usr/local" \
|
||||
-DCMAKE_MACOSX_BUNDLE=ON \
|
||||
-DCMAKE_OSX_ARCHITECTURES="${ARCH}" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}"
|
||||
fi
|
||||
cmake --build . --config "$BUILD_CONFIG" --target "$SLICER_BUILD_TARGET"
|
||||
)
|
||||
|
||||
echo "Verify localization with gettext..."
|
||||
(
|
||||
cd "$PROJECT_DIR"
|
||||
./run_gettext.sh
|
||||
)
|
||||
|
||||
echo "Fix macOS app package..."
|
||||
(
|
||||
cd "$PROJECT_BUILD_DIR"
|
||||
mkdir -p OrcaSlicer
|
||||
cd OrcaSlicer
|
||||
# remove previously built app
|
||||
rm -rf ./OrcaSlicer.app
|
||||
# fully copy newly built app
|
||||
cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer.app" ./OrcaSlicer.app
|
||||
# fix resources
|
||||
resources_path=$(readlink ./OrcaSlicer.app/Contents/Resources)
|
||||
rm ./OrcaSlicer.app/Contents/Resources
|
||||
cp -R "$resources_path" ./OrcaSlicer.app/Contents/Resources
|
||||
# delete .DS_Store file
|
||||
find ./OrcaSlicer.app/ -name '.DS_Store' -delete
|
||||
)
|
||||
|
||||
# extract version
|
||||
# export ver=$(grep '^#define SoftFever_VERSION' ../src/libslic3r/libslic3r_version.h | cut -d ' ' -f3)
|
||||
# ver="_V${ver//\"}"
|
||||
# echo $PWD
|
||||
# if [ "1." != "$NIGHTLY_BUILD". ];
|
||||
# then
|
||||
# ver=${ver}_dev
|
||||
# fi
|
||||
|
||||
# zip -FSr OrcaSlicer${ver}_Mac_${ARCH}.zip OrcaSlicer.app
|
||||
}
|
||||
|
||||
function build_universal() {
|
||||
echo "Building universal binary..."
|
||||
# Save current ARCH
|
||||
ORIGINAL_ARCH="$ARCH"
|
||||
|
||||
# Build x86_64
|
||||
ARCH="x86_64"
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build_$ARCH"
|
||||
DEPS_BUILD_DIR="$DEPS_DIR/build_$ARCH"
|
||||
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep_$ARCH"
|
||||
build_deps
|
||||
build_slicer
|
||||
|
||||
# Build arm64
|
||||
ARCH="arm64"
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build_$ARCH"
|
||||
DEPS_BUILD_DIR="$DEPS_DIR/build_$ARCH"
|
||||
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep_$ARCH"
|
||||
build_deps
|
||||
build_slicer
|
||||
|
||||
# Restore original ARCH
|
||||
ARCH="$ORIGINAL_ARCH"
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build_$ARCH"
|
||||
DEPS_BUILD_DIR="$DEPS_DIR/build_$ARCH"
|
||||
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep_$ARCH"
|
||||
|
||||
# Create universal binary
|
||||
echo "Creating universal binary..."
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build_Universal"
|
||||
mkdir -p "$PROJECT_BUILD_DIR/OrcaSlicer"
|
||||
UNIVERSAL_APP="$PROJECT_BUILD_DIR/OrcaSlicer/Universal_OrcaSlicer.app"
|
||||
rm -rf "$UNIVERSAL_APP"
|
||||
cp -R "$PROJECT_DIR/build_x86_64/OrcaSlicer/OrcaSlicer.app" "$UNIVERSAL_APP"
|
||||
|
||||
# Get the binary path inside the .app bundle
|
||||
BINARY_PATH="Contents/MacOS/OrcaSlicer"
|
||||
|
||||
# Create universal binary using lipo
|
||||
lipo -create \
|
||||
"$PROJECT_DIR/build_x86_64/OrcaSlicer/OrcaSlicer.app/$BINARY_PATH" \
|
||||
"$PROJECT_DIR/build_arm64/OrcaSlicer/OrcaSlicer.app/$BINARY_PATH" \
|
||||
-output "$UNIVERSAL_APP/$BINARY_PATH"
|
||||
|
||||
echo "Universal binary created at $UNIVERSAL_APP"
|
||||
}
|
||||
|
||||
case "${BUILD_TARGET}" in
|
||||
all)
|
||||
if [ "1." == "$BUILD_UNIVERSAL". ]; then
|
||||
build_universal
|
||||
else
|
||||
build_deps
|
||||
build_slicer
|
||||
fi
|
||||
;;
|
||||
deps)
|
||||
build_deps
|
||||
;;
|
||||
slicer)
|
||||
if [ "1." == "$BUILD_UNIVERSAL". ]; then
|
||||
build_universal
|
||||
else
|
||||
build_slicer
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Unknown target: $BUILD_TARGET. Available targets: deps, slicer, all."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "1." == "$PACK_DEPS". ]; then
|
||||
pack_deps
|
||||
fi
|
||||
@@ -1,67 +0,0 @@
|
||||
@REM OcarSlicer build script for Windows
|
||||
@echo off
|
||||
set WP=%CD%
|
||||
|
||||
@REM Pack deps
|
||||
if "%1"=="pack" (
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
cd %WP%/deps/build
|
||||
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set build_date=%%c%%b%%a
|
||||
echo packing deps: OrcaSlicer_dep_win64_!build_date!_vs2022.zip
|
||||
|
||||
%WP%/tools/7z.exe a OrcaSlicer_dep_win64_!build_date!_vs2022.zip OrcaSlicer_dep
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
set debug=OFF
|
||||
set debuginfo=OFF
|
||||
if "%1"=="debug" set debug=ON
|
||||
if "%2"=="debug" set debug=ON
|
||||
if "%1"=="debuginfo" set debuginfo=ON
|
||||
if "%2"=="debuginfo" set debuginfo=ON
|
||||
if "%debug%"=="ON" (
|
||||
set build_type=Debug
|
||||
set build_dir=build-dbg
|
||||
) else (
|
||||
if "%debuginfo%"=="ON" (
|
||||
set build_type=RelWithDebInfo
|
||||
set build_dir=build-dbginfo
|
||||
) else (
|
||||
set build_type=Release
|
||||
set build_dir=build
|
||||
)
|
||||
)
|
||||
echo build type set to %build_type%
|
||||
|
||||
setlocal DISABLEDELAYEDEXPANSION
|
||||
cd deps
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
set DEPS=%CD%/OrcaSlicer_dep
|
||||
|
||||
if "%1"=="slicer" (
|
||||
GOTO :slicer
|
||||
)
|
||||
echo "building deps.."
|
||||
|
||||
echo on
|
||||
cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%DEPS%" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo%
|
||||
cmake --build . --config %build_type% --target deps -- -m
|
||||
@echo off
|
||||
|
||||
if "%1"=="deps" exit /b 0
|
||||
|
||||
:slicer
|
||||
echo "building Orca Slicer..."
|
||||
cd %WP%
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
|
||||
echo on
|
||||
cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="%WindowsSdkDir%Include\%WindowsSDKVersion%\"
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
@echo off
|
||||
cd ..
|
||||
call run_gettext.bat
|
||||
cd %build_dir%
|
||||
cmake --build . --target install --config %build_type%
|
||||
495
build_win.bat
Normal file
@@ -0,0 +1,495 @@
|
||||
@setlocal disableDelayedExpansion enableExtensions
|
||||
@IF "%PS_ECHO_ON%" NEQ "" (echo on) ELSE (echo off)
|
||||
@GOTO :MAIN
|
||||
:HELP
|
||||
@ECHO.
|
||||
@ECHO Performs initial build or rebuild of the app (build) and deps (build/deps).
|
||||
@ECHO Default options are determined from build directories and system state.
|
||||
@ECHO.
|
||||
@ECHO Usage: build_win [-ARCH ^<arch^>] [-CONFIG ^<config^>] [-VERSION ^<version^>]
|
||||
@ECHO [-PRODUCT ^<product^>] [-DESTDIR ^<directory^>]
|
||||
@ECHO [-STEPS ^<all^|all-dirty^|app^|app-dirty^|deps^|deps-dirty^>]
|
||||
@ECHO [-RUN ^<console^|custom^|none^|viewer^|window^>]
|
||||
@ECHO.
|
||||
@ECHO -a -ARCH Target processor architecture
|
||||
@ECHO Default: %PS_ARCH_HOST%
|
||||
@ECHO -c -CONFIG MSVC project config
|
||||
@ECHO Default: %PS_CONFIG_DEFAULT%
|
||||
@ECHO -v -VERSION Major version number of MSVC installation to use for build
|
||||
@ECHO Default: %PS_VERSION_SUPPORTED%
|
||||
@ECHO -p -PRODUCT Product ID of MSVC installation to use for build
|
||||
@ECHO Default: %PS_PRODUCT_DEFAULT%
|
||||
@ECHO -s -STEPS Performs only the specified build steps:
|
||||
@ECHO all - clean and build deps and app
|
||||
@ECHO all-dirty - build deps and app without cleaning
|
||||
@ECHO app - clean and build main applications
|
||||
@ECHO app-dirty - build main applications without cleaning
|
||||
@ECHO deps - clean and build deps
|
||||
@ECHO deps-dirty - build deps without cleaning
|
||||
@ECHO Default: %PS_STEPS_DEFAULT%
|
||||
@ECHO -r -RUN Specifies what to perform at the run step:
|
||||
@ECHO console - run and wait on bambu-studio-console.exe
|
||||
@ECHO custom - run and wait on your custom build/%PS_CUSTOM_RUN_FILE%
|
||||
@ECHO ide - open project in Visual Studio if not open (no wait)
|
||||
@ECHO none - run step does nothing
|
||||
@ECHO viewer - run bambu-gcodeviewer.exe (no wait)
|
||||
@ECHO window - run bambu-studio.exe (no wait)
|
||||
@ECHO Default: none
|
||||
@ECHO -d -DESTDIR Deps destination directory
|
||||
@ECHO Warning: Changing destdir path will not delete the old destdir.
|
||||
@ECHO Default: %PS_DESTDIR_DEFAULT_MSG%
|
||||
@ECHO.
|
||||
@ECHO Examples:
|
||||
@ECHO.
|
||||
@ECHO Initial build: build_win -d "c:\src\BambuSlicer-deps"
|
||||
@ECHO Build post deps change: build_win -s all
|
||||
@ECHO App dirty build: build_win
|
||||
@ECHO App dirty build ^& run: build_win -r console
|
||||
@ECHO All clean build ^& run: build_win -s all -r console -d "deps\build\out_deps"
|
||||
@ECHO.
|
||||
GOTO :END
|
||||
|
||||
:MAIN
|
||||
REM Script constants
|
||||
SET START_TIME=%TIME%
|
||||
SET PS_START_DIR=%CD%
|
||||
SET PS_SOLUTION_NAME=BambuStudio
|
||||
SET PS_CHOICE_TIMEOUT=30
|
||||
SET PS_CUSTOM_RUN_FILE=custom_run.bat
|
||||
SET PS_DEPS_PATH_FILE_NAME=.DEPS_PATH.txt
|
||||
SET PS_DEPS_PATH_FILE=%~dp0deps\build\%PS_DEPS_PATH_FILE_NAME%
|
||||
SET PS_CONFIG_LIST="Debug;MinSizeRel;Release;RelWithDebInfo"
|
||||
|
||||
REM The officially supported toolchain version is 16 (Visual Studio 2019)
|
||||
REM TODO: Update versions after Boost gets rolled to 1.78 or later
|
||||
SET PS_VERSION_SUPPORTED=16
|
||||
SET PS_VERSION_EXCEEDED=17
|
||||
SET VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe
|
||||
IF NOT EXIST "%VSWHERE%" SET VSWHERE=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe
|
||||
FOR /F "tokens=4 USEBACKQ delims=." %%I IN (`"%VSWHERE%" -nologo -property productId`) DO SET PS_PRODUCT_DEFAULT=%%I
|
||||
IF "%PS_PRODUCT_DEFAULT%" EQU "" (
|
||||
SET EXIT_STATUS=-1
|
||||
@ECHO ERROR: No Visual Studio installation found. 1>&2
|
||||
GOTO :HELP
|
||||
)
|
||||
REM Default to the latest supported version if multiple are available
|
||||
FOR /F "tokens=1 USEBACKQ delims=." %%I IN (
|
||||
`^""%VSWHERE%" -version "[%PS_VERSION_SUPPORTED%,%PS_VERSION_EXCEEDED%)" -latest -nologo -property catalog_buildVersion^"`
|
||||
) DO SET PS_VERSION_SUPPORTED=%%I
|
||||
|
||||
REM Probe build directories and system state for reasonable default arguments
|
||||
pushd %~dp0
|
||||
SET PS_CONFIG=RelWithDebInfo
|
||||
SET PS_ARCH=%PROCESSOR_ARCHITECTURE:amd64=x64%
|
||||
CALL :TOLOWER PS_ARCH
|
||||
SET PS_RUN=none
|
||||
SET PS_DESTDIR=
|
||||
SET PS_VERSION=
|
||||
SET PS_PRODUCT=%PS_PRODUCT_DEFAULT%
|
||||
CALL :RESOLVE_DESTDIR_CACHE
|
||||
|
||||
REM Set up parameters used by help menu
|
||||
SET EXIT_STATUS=0
|
||||
SET PS_CONFIG_DEFAULT=%PS_CONFIG%
|
||||
SET PS_ARCH_HOST=%PS_ARCH%
|
||||
(echo " -help /help -h /h -? /? ")| findstr /I /C:" %~1 ">nul && GOTO :HELP
|
||||
|
||||
REM Parse arguments
|
||||
SET EXIT_STATUS=1
|
||||
SET PS_CURRENT_STEP=arguments
|
||||
SET PARSER_STATE=
|
||||
SET PARSER_FAIL=
|
||||
FOR %%I in (%*) DO CALL :PARSE_OPTION "ARCH CONFIG DESTDIR STEPS RUN VERSION PRODUCT" PARSER_STATE "%%~I"
|
||||
IF "%PARSER_FAIL%" NEQ "" (
|
||||
@ECHO ERROR: Invalid switch: %PARSER_FAIL% 1>&2
|
||||
GOTO :HELP
|
||||
)ELSE IF "%PARSER_STATE%" NEQ "" (
|
||||
@ECHO ERROR: Missing parameter for: %PARSER_STATE% 1>&2
|
||||
GOTO :HELP
|
||||
)
|
||||
|
||||
REM Validate arguments
|
||||
SET PS_ASK_TO_CONTINUE=
|
||||
CALL :TOLOWER PS_ARCH
|
||||
SET PS_ARCH=%PS_ARCH:amd64=x64%
|
||||
CALL :PARSE_OPTION_VALUE %PS_CONFIG_LIST:;= % PS_CONFIG
|
||||
IF "%PS_CONFIG%" EQU "" GOTO :HELP
|
||||
REM RESOLVE_DESTDIR_CACHE must go after PS_ARCH and PS_CONFIG, but before PS STEPS
|
||||
CALL :RESOLVE_DESTDIR_CACHE
|
||||
IF "%PS_STEPS%" EQU "" SET PS_STEPS=%PS_STEPS_DEFAULT%
|
||||
CALL :PARSE_OPTION_VALUE "all all-dirty deps-dirty deps app-dirty app app-cmake" PS_STEPS
|
||||
IF "%PS_STEPS%" EQU "" GOTO :HELP
|
||||
(echo %PS_STEPS%)| findstr /I /C:"dirty">nul && SET PS_STEPS_DIRTY=1 || SET PS_STEPS_DIRTY=
|
||||
IF "%PS_STEPS%" EQU "app-cmake" SET PS_STEPS_DIRTY=1
|
||||
IF "%PS_DESTDIR%" EQU "" SET PS_DESTDIR=%PS_DESTDIR_CACHED%
|
||||
IF "%PS_DESTDIR%" EQU "" (
|
||||
@ECHO ERROR: Parameter required: -DESTDIR 1>&2
|
||||
GOTO :HELP
|
||||
)
|
||||
CALL :CANONICALIZE_PATH PS_DESTDIR "%PS_START_DIR%"
|
||||
IF "%PS_DESTDIR%" NEQ "%PS_DESTDIR_CACHED%" (
|
||||
(echo "all deps all-dirty deps-dirty")| findstr /I /C:"%PS_STEPS%">nul || (
|
||||
IF EXIST "%PS_DESTDIR%" (
|
||||
@ECHO WARNING: DESTDIR does not match cache: 1>&2
|
||||
@ECHO WARNING: new: %PS_DESTDIR% 1>&2
|
||||
@ECHO WARNING: old: %PS_DESTDIR_CACHED% 1>&2
|
||||
SET PS_ASK_TO_CONTINUE=1
|
||||
) ELSE (
|
||||
@ECHO ERROR: Invalid parameter: DESTDIR=%PS_DESTDIR% 1>&2
|
||||
GOTO :HELP
|
||||
)
|
||||
)
|
||||
)
|
||||
SET PS_DESTDIR_DEFAULT_MSG=
|
||||
CALL :PARSE_OPTION_VALUE "console custom ide none viewer window" PS_RUN
|
||||
IF "%PS_RUN%" EQU "" GOTO :HELP
|
||||
IF "%PS_RUN%" NEQ "none" IF "%PS_STEPS:~0,4%" EQU "deps" (
|
||||
@ECHO ERROR: RUN=%PS_RUN% specified with STEPS=%PS_STEPS%
|
||||
@ECHO ERROR: RUN=none is the only valid option for STEPS "deps" or "deps-dirty"
|
||||
GOTO :HELP
|
||||
)
|
||||
IF DEFINED PS_VERSION (
|
||||
SET /A PS_VERSION_EXCEEDED=%PS_VERSION% + 1
|
||||
) ELSE SET PS_VERSION=%PS_VERSION_SUPPORTED%
|
||||
SET MSVC_FILTER=-products Microsoft.VisualStudio.Product.%PS_PRODUCT% -version "[%PS_VERSION%,%PS_VERSION_EXCEEDED%)"
|
||||
FOR /F "tokens=* USEBACKQ" %%I IN (`^""%VSWHERE%" %MSVC_FILTER% -nologo -property installationPath^"`) DO SET MSVC_DIR=%%I
|
||||
IF NOT EXIST "%MSVC_DIR%" (
|
||||
@ECHO ERROR: Compatible Visual Studio installation not found. 1>&2
|
||||
GOTO :HELP
|
||||
)
|
||||
REM Give the user a chance to cancel if we found something odd.
|
||||
IF "%PS_ASK_TO_CONTINUE%" EQU "" GOTO :BUILD_ENV
|
||||
@ECHO.
|
||||
@ECHO Unexpected parameters detected. Build paused for %PS_CHOICE_TIMEOUT% seconds.
|
||||
choice /T %PS_CHOICE_TIMEOUT% /C YN /D N /M "Continue"
|
||||
IF %ERRORLEVEL% NEQ 1 GOTO :HELP
|
||||
|
||||
REM Set up MSVC environment
|
||||
:BUILD_ENV
|
||||
SET EXIT_STATUS=2
|
||||
SET PS_CURRENT_STEP=environment
|
||||
@ECHO **********************************************************************
|
||||
@ECHO ** Build Config: %PS_CONFIG%
|
||||
@ECHO ** Target Arch: %PS_ARCH%
|
||||
@ECHO ** Build Steps: %PS_STEPS%
|
||||
@ECHO ** Run App: %PS_RUN%
|
||||
@ECHO ** Deps path: %PS_DESTDIR%
|
||||
@ECHO ** Using Microsoft Visual Studio installation found at:
|
||||
@ECHO ** %MSVC_DIR%
|
||||
CALL "%MSVC_DIR%\Common7\Tools\vsdevcmd.bat" -arch=%PS_ARCH% -host_arch=%PS_ARCH_HOST% -app_platform=Desktop
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO :END
|
||||
REM Need to reset the echo state after vsdevcmd.bat clobbers it.
|
||||
@IF "%PS_ECHO_ON%" NEQ "" (echo on) ELSE (echo off)
|
||||
IF "%PS_DRY_RUN_ONLY%" NEQ "" (
|
||||
@ECHO Script terminated early because PS_DRY_RUN_ONLY is set. 1>&2
|
||||
GOTO :END
|
||||
)
|
||||
IF /I "%PS_STEPS:~0,3%" EQU "app" GOTO :BUILD_APP
|
||||
|
||||
REM Build deps
|
||||
:BUILD_DEPS
|
||||
SET EXIT_STATUS=3
|
||||
SET PS_CURRENT_STEP=deps
|
||||
IF "%PS_STEPS_DIRTY%" EQU "" (
|
||||
CALL :MAKE_OR_CLEAN_DIRECTORY deps\build "%PS_DEPS_PATH_FILE_NAME%" .vs
|
||||
CALL :MAKE_OR_CLEAN_DIRECTORY "%PS_DESTDIR%"
|
||||
)
|
||||
cd deps\build || GOTO :END
|
||||
cmake.exe .. -DDESTDIR="%PS_DESTDIR%"
|
||||
IF %ERRORLEVEL% NEQ 0 IF "%PS_STEPS_DIRTY%" NEQ "" (
|
||||
(del CMakeCache.txt && cmake.exe .. -DDESTDIR="%PS_DESTDIR%") || GOTO :END
|
||||
) ELSE GOTO :END
|
||||
(echo %PS_DESTDIR%)> "%PS_DEPS_PATH_FILE%"
|
||||
msbuild /m ALL_BUILD.vcxproj /p:Configuration=%PS_CONFIG% /v:quiet || GOTO :END
|
||||
cd ..\..
|
||||
IF /I "%PS_STEPS:~0,4%" EQU "deps" GOTO :RUN_APP
|
||||
|
||||
REM Build app
|
||||
:BUILD_APP
|
||||
SET EXIT_STATUS=4
|
||||
SET PS_CURRENT_STEP=app
|
||||
IF "%PS_STEPS_DIRTY%" EQU "" CALL :MAKE_OR_CLEAN_DIRECTORY build "%PS_CUSTOM_RUN_FILE%" .vs
|
||||
cd build || GOTO :END
|
||||
REM Make sure we have a custom batch file skeleton for the run stage
|
||||
set PS_CUSTOM_BAT=%PS_CUSTOM_RUN_FILE%
|
||||
CALL :CANONICALIZE_PATH PS_CUSTOM_BAT
|
||||
IF NOT EXIST %PS_CUSTOM_BAT% CALL :WRITE_CUSTOM_SCRIPT_SKELETON %PS_CUSTOM_BAT%
|
||||
SET PS_PROJECT_IS_OPEN=
|
||||
FOR /F "tokens=2 delims=," %%I in (
|
||||
'tasklist /V /FI "IMAGENAME eq devenv.exe " /NH /FO CSV ^| find "%PS_SOLUTION_NAME%"'
|
||||
) do SET PS_PROJECT_IS_OPEN=%%~I
|
||||
cmake.exe .. -DCMAKE_PREFIX_PATH="%PS_DESTDIR%\usr\local" -DCMAKE_CONFIGURATION_TYPES=%PS_CONFIG_LIST%
|
||||
IF %ERRORLEVEL% NEQ 0 IF "%PS_STEPS_DIRTY%" NEQ "" (
|
||||
(del CMakeCache.txt && cmake.exe .. -DCMAKE_PREFIX_PATH="%PS_DESTDIR%\usr\local" -DCMAKE_CONFIGURATION_TYPES=%PS_CONFIG_LIST%) || GOTO :END
|
||||
) ELSE GOTO :END
|
||||
REM Skip the build step if we're using the undocumented app-cmake to regenerate the full config from inside devenv
|
||||
IF "%PS_STEPS%" NEQ "app-cmake" msbuild /m ALL_BUILD.vcxproj /p:Configuration=%PS_CONFIG% /v:quiet || GOTO :END
|
||||
(echo %PS_DESTDIR%)> "%PS_DEPS_PATH_FILE_FOR_CONFIG%"
|
||||
|
||||
REM Run app
|
||||
:RUN_APP
|
||||
REM All build steps complete.
|
||||
CALL :DIFF_TIME ELAPSED_TIME %START_TIME% %TIME%
|
||||
IF "%PS_CURRENT_STEP%" NEQ "arguments" (
|
||||
@ECHO.
|
||||
@ECHO Total Build Time Elapsed %ELAPSED_TIME%
|
||||
)
|
||||
SET EXIT_STATUS=5
|
||||
SET PS_CURRENT_STEP=run
|
||||
IF "%PS_RUN%" EQU "none" GOTO :PROLOGUE
|
||||
cd src\%PS_CONFIG% || GOTO :END
|
||||
SET PS_PROJECT_IS_OPEN=
|
||||
FOR /F "tokens=2 delims=," %%I in (
|
||||
'tasklist /V /FI "IMAGENAME eq devenv.exe " /NH /FO CSV ^| find "%PS_SOLUTION_NAME%"'
|
||||
) do SET PS_PROJECT_IS_OPEN=%%~I
|
||||
@ECHO.
|
||||
@ECHO Running %PS_RUN% application...
|
||||
@REM icacls below is just a hack for file-not-found error handling
|
||||
IF "%PS_RUN%" EQU "console" (
|
||||
icacls bambu-studio-console.exe >nul || GOTO :END
|
||||
start /wait /b bambu-studio-console.exe
|
||||
) ELSE IF "%PS_RUN%" EQU "window" (
|
||||
icacls bambu-studio.exe >nul || GOTO :END
|
||||
start bambu-studio.exe
|
||||
) ELSE IF "%PS_RUN%" EQU "viewer" (
|
||||
icacls bambu-gcodeviewer.exe >nul || GOTO :END
|
||||
start bambu-gcodeviewer.exe
|
||||
) ELSE IF "%PS_RUN%" EQU "custom" (
|
||||
icacls %PS_CUSTOM_BAT% >nul || GOTO :END
|
||||
CALL %PS_CUSTOM_BAT%
|
||||
) ELSE IF "%PS_RUN%" EQU "ide" (
|
||||
IF "%PS_PROJECT_IS_OPEN%" NEQ "" (
|
||||
@ECHO WARNING: Solution is already open in Visual Studio. Skipping ide run step. 1>&2
|
||||
) ELSE (
|
||||
@ECHO Preparing to run Visual Studio...
|
||||
cd ..\.. || GOTO :END
|
||||
REM This hack generates a single config for MSVS, guaranteeing it gets set as the active config.
|
||||
cmake.exe .. -DCMAKE_PREFIX_PATH="%PS_DESTDIR%\usr\local" -DCMAKE_CONFIGURATION_TYPES=%PS_CONFIG% > nul 2> nul || GOTO :END
|
||||
REM Now launch devenv with the single config (setting it active) and a /command switch to re-run cmake and generate the full config list
|
||||
start devenv.exe %PS_SOLUTION_NAME%.sln /command ^"shell /o ^^^"%~f0^^^" -d ^^^"%PS_DESTDIR%^^^" -c %PS_CONFIG% -a %PS_ARCH% -r none -s app-cmake^"
|
||||
REM If devenv fails to launch just directly regenerate the full config list.
|
||||
IF %ERRORLEVEL% NEQ 0 (
|
||||
cmake.exe .. -DCMAKE_PREFIX_PATH="%PS_DESTDIR%\usr\local" -DCMAKE_CONFIGURATION_TYPES=%PS_CONFIG_LIST% 2> nul 1> nul || GOTO :END
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@REM ********** DON'T ADD ANY CODE BETWEEN THESE TWO SECTIONS **********
|
||||
@REM RUN_APP may hand off control, so let exit codes fall through to PROLOGUE.
|
||||
|
||||
:PROLOGUE
|
||||
SET EXIT_STATUS=%ERRORLEVEL%
|
||||
:END
|
||||
@IF "%PS_ECHO_ON%%PS_DRY_RUN_ONLY%" NEQ "" (
|
||||
@ECHO **********************************************************************
|
||||
@ECHO ** Script Parameters:
|
||||
@ECHO **********************************************************************
|
||||
@SET PS_
|
||||
)
|
||||
IF "%EXIT_STATUS%" NEQ "0" (
|
||||
IF "%PS_CURRENT_STEP%" NEQ "arguments" (
|
||||
@ECHO.
|
||||
@ECHO ERROR: *** Build process failed at %PS_CURRENT_STEP% step. *** 1>&2
|
||||
)
|
||||
) ELSE (
|
||||
@ECHO All steps completed successfully.
|
||||
)
|
||||
popd
|
||||
exit /B %EXIT_STATUS%
|
||||
|
||||
GOTO :EOF
|
||||
REM Functions and stubs start here.
|
||||
|
||||
:RESOLVE_DESTDIR_CACHE
|
||||
@REM Resolves all DESTDIR cache values and sets PS_STEPS_DEFAULT
|
||||
@REM Note: This just sets global variables, so it doesn't use setlocal.
|
||||
SET PS_DEPS_PATH_FILE_FOR_CONFIG=%~dp0build\.vs\%PS_ARCH%\%PS_CONFIG%\%PS_DEPS_PATH_FILE_NAME%
|
||||
mkdir "%~dp0build\.vs\%PS_ARCH%\%PS_CONFIG%" > nul 2> nul
|
||||
REM Copy a legacy file if we don't have one in the proper location.
|
||||
echo f|xcopy /D "%~dp0build\%PS_ARCH%\%PS_CONFIG%\%PS_DEPS_PATH_FILE_NAME%" "%PS_DEPS_PATH_FILE_FOR_CONFIG%" > nul 2> nul
|
||||
CALL :CANONICALIZE_PATH PS_DEPS_PATH_FILE_FOR_CONFIG
|
||||
IF EXIST "%PS_DEPS_PATH_FILE_FOR_CONFIG%" (
|
||||
FOR /F "tokens=* USEBACKQ" %%I IN ("%PS_DEPS_PATH_FILE_FOR_CONFIG%") DO (
|
||||
SET PS_DESTDIR_CACHED=%%I
|
||||
SET PS_DESTDIR_DEFAULT_MSG=%%I
|
||||
)
|
||||
SET PS_STEPS_DEFAULT=app-dirty
|
||||
) ELSE IF EXIST "%PS_DEPS_PATH_FILE%" (
|
||||
FOR /F "tokens=* USEBACKQ" %%I IN ("%PS_DEPS_PATH_FILE%") DO (
|
||||
SET PS_DESTDIR_CACHED=%%I
|
||||
SET PS_DESTDIR_DEFAULT_MSG=%%I
|
||||
)
|
||||
SET PS_STEPS_DEFAULT=app
|
||||
) ELSE (
|
||||
SET PS_DESTDIR_CACHED=
|
||||
SET PS_DESTDIR_DEFAULT_MSG=Cache missing. Argument required.
|
||||
SET PS_STEPS_DEFAULT=all
|
||||
)
|
||||
GOTO :EOF
|
||||
|
||||
:PARSE_OPTION
|
||||
@REM Argument parser called for each argument
|
||||
@REM %1 - Valid option list
|
||||
@REM %2 - Variable name for parser state; must be unset when parsing finished
|
||||
@REM %3 - Current argument value
|
||||
@REM PARSER_FAIL will be set on an error
|
||||
@REM Note: Must avoid delayed expansion since filenames may contain ! character
|
||||
setlocal disableDelayedExpansion
|
||||
IF "%PARSER_FAIL%" NEQ "" GOTO :EOF
|
||||
CALL SET LAST_ARG=%%%2%%
|
||||
IF "%LAST_ARG%" EQU "" (
|
||||
CALL :PARSE_OPTION_NAME %1 %~2 %~3 1
|
||||
SET ARG_TYPE=NAME
|
||||
) ELSE (
|
||||
SET PS_SET_COMMAND=SET PS_%LAST_ARG%=%~3
|
||||
SET ARG_TYPE=LAST_ARG
|
||||
SET %~2=
|
||||
)
|
||||
CALL SET LAST_ARG=%%%2%%
|
||||
IF "%LAST_ARG%%ARG_TYPE%" EQU "NAME" SET PARSER_FAIL=%~3
|
||||
(
|
||||
endlocal
|
||||
SET PARSER_FAIL=%PARSER_FAIL%
|
||||
SET %~2=%LAST_ARG%
|
||||
%PS_SET_COMMAND%
|
||||
)
|
||||
GOTO :EOF
|
||||
|
||||
:PARSE_OPTION_VALUE
|
||||
setlocal disableDelayedExpansion
|
||||
@REM Parses value and verifies it is within the supplied list
|
||||
@REM %1 - Valid option list
|
||||
@REM %2 - In/out variable name; unset on error
|
||||
CALL SET NAME=%~2
|
||||
CALL SET SAVED_VALUE=%%%NAME%%%
|
||||
CALL :PARSE_OPTION_NAME %1 %NAME% -%SAVED_VALUE%
|
||||
CALL SET NEW_VALUE=%%%NAME%%%
|
||||
IF "%NEW_VALUE%" EQU "" (
|
||||
@ECHO ERROR: Invalid parameter: %NAME:~3%=%SAVED_VALUE% 1>&2
|
||||
)
|
||||
endlocal & SET %NAME%=%NEW_VALUE%
|
||||
GOTO :EOF
|
||||
|
||||
:PARSE_OPTION_NAME
|
||||
@REM Parses an option name
|
||||
@REM %1 - Valid option list
|
||||
@REM %2 - Out variable name; unset on error
|
||||
@REM %3 - Current argument value
|
||||
@REM %4 - Boolean indicating single character switches are valid
|
||||
@REM Note: Delayed expansion safe because ! character is invalid in option name
|
||||
setlocal enableDelayedExpansion
|
||||
IF "%4" NEQ "" FOR %%I IN (%~1) DO @(
|
||||
SET SHORT_NAME=%%~I
|
||||
SET SHORT_ARG_!SHORT_NAME:~0,1!=%%~I
|
||||
)
|
||||
@SET OPTION_NAME=%~3
|
||||
@(echo %OPTION_NAME%)| findstr /R /C:"[-/]..*">nul || GOTO :PARSE_OPTION_NAME_FAIL
|
||||
@SET OPTION_NAME=%OPTION_NAME:~1%
|
||||
IF "%4" NEQ "" (
|
||||
IF "%OPTION_NAME%" EQU "%OPTION_NAME:~0,1%" (
|
||||
IF "!SHORT_ARG_%OPTION_NAME:~0,1%!" NEQ "" SET OPTION_NAME=!SHORT_ARG_%OPTION_NAME:~0,1%!
|
||||
)
|
||||
)
|
||||
@(echo %OPTION_NAME%)| findstr /R /C:".[ ][ ]*.">nul && GOTO :PARSE_OPTION_NAME_FAIL
|
||||
@(echo %~1 )| findstr /I /C:" %OPTION_NAME% ">nul || GOTO :PARSE_OPTION_NAME_FAIL
|
||||
FOR %%I IN (%~1) DO SET OPTION_NAME=!OPTION_NAME:%%~I=%%~I!
|
||||
endlocal & SET %~2=%OPTION_NAME%
|
||||
GOTO :EOF
|
||||
:PARSE_OPTION_NAME_FAIL
|
||||
endlocal & SET %~2=
|
||||
GOTO :EOF
|
||||
|
||||
:MAKE_OR_CLEAN_DIRECTORY
|
||||
@REM Create directory if it doesn't exist or clean it if it does
|
||||
@REM %1 - Directory path to clean or create
|
||||
@REM %* - Optional list of files/dirs to keep (in the base directory only)
|
||||
setlocal disableDelayedExpansion
|
||||
IF NOT EXIST "%~1" (
|
||||
@ECHO Creating %~1
|
||||
mkdir "%~1" && (
|
||||
endlocal
|
||||
GOTO :EOF
|
||||
)
|
||||
)
|
||||
@ECHO Cleaning %~1 ...
|
||||
SET KEEP_LIST=
|
||||
:MAKE_OR_CLEAN_DIRECTORY_ARG_LOOP
|
||||
IF "%~2" NEQ "" (
|
||||
SET KEEP_LIST=%KEEP_LIST% "%~2"
|
||||
SHIFT /2
|
||||
GOTO :MAKE_OR_CLEAN_DIRECTORY_ARG_LOOP
|
||||
)
|
||||
for /F "usebackq delims=" %%I in (`dir /a /b "%~1"`) do (
|
||||
(echo %KEEP_LIST%)| findstr /I /L /C:"\"%%I\"">nul || (
|
||||
rmdir /s /q "%~1\%%I" 2>nul ) || del /q /f "%~1\%%I"
|
||||
)
|
||||
endlocal
|
||||
GOTO :EOF
|
||||
|
||||
:TOLOWER
|
||||
@REM Converts supplied environment variable to lowercase
|
||||
@REM %1 - Input/output variable name
|
||||
@REM Note: This is slow on very long strings, but is used only on very short ones
|
||||
setlocal disableDelayedExpansion
|
||||
@FOR %%b IN (a b c d e f g h i j k l m n o p q r s t u v w x y z) DO @CALL set %~1=%%%1:%%b=%%b%%
|
||||
@CALL SET OUTPUT=%%%~1%%
|
||||
endlocal & SET %~1=%OUTPUT%
|
||||
GOTO :EOF
|
||||
|
||||
:CANONICALIZE_PATH
|
||||
@REM Canonicalizes the path in the supplied variable
|
||||
@REM %1 - Input/output variable containing path to canonicalize
|
||||
@REM %2 - Optional base directory
|
||||
setlocal
|
||||
CALL :CANONICALIZE_PATH_INNER %1 %%%~1%% %2
|
||||
endlocal & SET %~1=%OUTPUT%
|
||||
GOTO :EOF
|
||||
:CANONICALIZE_PATH_INNER
|
||||
if "%~3" NEQ "" (pushd %3 || GOTO :EOF)
|
||||
SET OUTPUT=%~f2
|
||||
if "%~3" NEQ "" popd
|
||||
GOTO :EOF
|
||||
|
||||
:DIFF_TIME
|
||||
@REM Calculates elapsed time between two timestamps (TIME environment variable format)
|
||||
@REM %1 - Output variable
|
||||
@REM %2 - Start time
|
||||
@REM %3 - End time
|
||||
setlocal EnableDelayedExpansion
|
||||
set START_ARG=%2
|
||||
set END_ARG=%3
|
||||
set END=!END_ARG:%TIME:~8,1%=%%100)*100+1!
|
||||
set START=!START_ARG:%TIME:~8,1%=%%100)*100+1!
|
||||
set /A DIFF=((((10!END:%TIME:~2,1%=%%100)*60+1!%%100)-((((10!START:%TIME:~2,1%=%%100)*60+1!%%100), DIFF-=(DIFF^>^>31)*24*60*60*100
|
||||
set /A CC=DIFF%%100+100,DIFF/=100,SS=DIFF%%60+100,DIFF/=60,MM=DIFF%%60+100,HH=DIFF/60+100
|
||||
@endlocal & set %1=%HH:~1%%TIME:~2,1%%MM:~1%%TIME:~2,1%%SS:~1%%TIME:~8,1%%CC:~1%
|
||||
@GOTO :EOF
|
||||
|
||||
:WRITE_CUSTOM_SCRIPT_SKELETON
|
||||
@REM Writes the following text to the supplied file
|
||||
@REM %1 - Output filename
|
||||
setlocal
|
||||
@(
|
||||
ECHO @ECHO.
|
||||
ECHO @ECHO ********************************************************************************
|
||||
ECHO @ECHO ** This is a custom run script skeleton.
|
||||
ECHO @ECHO ********************************************************************************
|
||||
ECHO @ECHO.
|
||||
ECHO @ECHO ********************************************************************************
|
||||
ECHO @ECHO ** The working directory is:
|
||||
ECHO @ECHO ********************************************************************************
|
||||
ECHO dir
|
||||
ECHO @ECHO.
|
||||
ECHO @ECHO ********************************************************************************
|
||||
ECHO @ECHO ** The environment is:
|
||||
ECHO @ECHO ********************************************************************************
|
||||
ECHO set
|
||||
ECHO @ECHO.
|
||||
ECHO @ECHO ********************************************************************************
|
||||
ECHO @ECHO ** Edit or replace this script to run custom steps after a successful build:
|
||||
ECHO @ECHO ** %~1
|
||||
ECHO @ECHO ********************************************************************************
|
||||
ECHO @ECHO.
|
||||
) > "%~1"
|
||||
endlocal
|
||||
GOTO :EOF
|
||||
@@ -64,6 +64,16 @@ This module defines the following variables:
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(GLEW CONFIG QUIET)
|
||||
|
||||
if(GLEW_FOUND)
|
||||
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_CONFIG)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: did not find GLEW CMake config file. Searching for libraries.")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
find_package(OpenGL QUIET)
|
||||
@@ -84,20 +94,19 @@ endif()
|
||||
|
||||
function(__glew_set_find_library_suffix shared_or_static)
|
||||
if((UNIX AND NOT APPLE) AND "${shared_or_static}" MATCHES "SHARED")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" PARENT_SCOPE)
|
||||
elseif((UNIX AND NOT APPLE) AND "${shared_or_static}" MATCHES "STATIC")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" PARENT_SCOPE)
|
||||
elseif(APPLE AND "${shared_or_static}" MATCHES "SHARED")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so" PARENT_SCOPE)
|
||||
elseif(APPLE AND "${shared_or_static}" MATCHES "STATIC")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" PARENT_SCOPE)
|
||||
elseif(WIN32 AND "${shared_or_static}" MATCHES "SHARED")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" PARENT_SCOPE)
|
||||
elseif(WIN32 AND "${shared_or_static}" MATCHES "STATIC")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.a;.dll.a")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.a;.dll.a" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}" PARENT_SCOPE)
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: CMAKE_FIND_LIBRARY_SUFFIXES for ${shared_or_static}: ${CMAKE_FIND_LIBRARY_SUFFIXES}")
|
||||
endif()
|
||||
|
||||
@@ -42,10 +42,5 @@ set(VERSION_OK FALSE)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
# Check for GDK Wayland support
|
||||
include(CheckSymbolExists)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${GTK3_INCLUDE_DIRS})
|
||||
check_symbol_exists(GDK_WINDOWING_WAYLAND "gdk/gdk.h" wxHAVE_GDK_WAYLAND)
|
||||
check_symbol_exists(GDK_WINDOWING_X11 "gdk/gdk.h" wxHAVE_GDK_X11)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_INCLUDE_DIRS GTK3_LIBRARIES VERSION_OK)
|
||||
|
||||
@@ -238,8 +238,7 @@ endif()
|
||||
set(OpenVDB_LIB_COMPONENTS "")
|
||||
set(OpenVDB_DEBUG_SUFFIX "d" CACHE STRING "Suffix for the debug libraries")
|
||||
|
||||
# get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
set(_is_multi FALSE)
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||
set(LIB_NAME ${COMPONENT})
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
# ported from PrusaSlicer
|
||||
# This is a wrapper of FindTBB which prefers the config scripts if available in the system
|
||||
# but only if building with dynamic dependencies. The config scripts potentially belong
|
||||
# to TBB >= 2020 which is incompatible with OpenVDB in our static dependency bundle.
|
||||
# This workaround is useful for package maintainers on Linux systems to use newer versions
|
||||
# of intel TBB (renamed to oneTBB from version 2021 up).
|
||||
set(_q "")
|
||||
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
|
||||
set(_q QUIET)
|
||||
endif()
|
||||
|
||||
# Only consider the config scripts if not building with the static dependencies
|
||||
# and this call is not made from a static dependency build (e.g. dep_OpenVDB will use this module)
|
||||
# BUILD_SHARED_LIBS will always be defined for dependency projects and will be OFF.
|
||||
# Newer versions of TBB also discourage from using TBB as a static library
|
||||
if (NOT SLIC3R_STATIC AND (NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS))
|
||||
find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q})
|
||||
|
||||
find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q})
|
||||
|
||||
if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
|
||||
if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
|
||||
message(STATUS "Falling back to MODULE search for ${CMAKE_FIND_PACKAGE_NAME}...")
|
||||
else()
|
||||
message(STATUS "${CMAKE_FIND_PACKAGE_NAME} found in ${${CMAKE_FIND_PACKAGE_NAME}_DIR}")
|
||||
if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
|
||||
if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
|
||||
message(STATUS "Falling back to MODULE search for ${CMAKE_FIND_PACKAGE_NAME}...")
|
||||
else()
|
||||
message(STATUS "${CMAKE_FIND_PACKAGE_NAME} found in ${${CMAKE_FIND_PACKAGE_NAME}_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif ()
|
||||
|
||||
if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindTBB.cmake.in)
|
||||
|
||||
@@ -293,7 +293,7 @@ if(NOT TBB_FOUND)
|
||||
# Create targets
|
||||
##################################
|
||||
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND AND NOT TARGET TBB::tbb)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND)
|
||||
add_library(TBB::tbb UNKNOWN IMPORTED)
|
||||
set_target_properties(TBB::tbb PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS}"
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
find_path(LIBNOISE_INCLUDE_DIR libnoise/noise.h)
|
||||
find_library(LIBNOISE_LIBRARY NAMES libnoise libnoise_static liblibnoise_static)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(libnoise DEFAULT_MSG
|
||||
LIBNOISE_LIBRARY
|
||||
LIBNOISE_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(libnoise_FOUND)
|
||||
add_library(noise::noise STATIC IMPORTED)
|
||||
set_target_properties(noise::noise PROPERTIES
|
||||
IMPORTED_LOCATION "${LIBNOISE_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBNOISE_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
@@ -11,7 +11,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.softfever3d.orca-slicer</string>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
@@ -26,126 +26,11 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
<key>ATSApplicationFontsPath</key>
|
||||
<string>fonts/</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>OrcaSlicer Downloads</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>orcaslicer</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>BambuStudio Downloads</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>bambustudioopen</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>stl</string>
|
||||
<string>STL</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/stl.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>STL</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LISsAppleDefaultForType</key>
|
||||
<true/>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>obj</string>
|
||||
<string>OBJ</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/OrcaSlicer.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>STL</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LISsAppleDefaultForType</key>
|
||||
<true/>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>amf</string>
|
||||
<string>AMF</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/OrcaSlicer.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>AMF</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LISsAppleDefaultForType</key>
|
||||
<true/>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>3mf</string>
|
||||
<string>3MF</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/OrcaSlicer.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>3MF</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LISsAppleDefaultForType</key>
|
||||
<true/>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>gcode</string>
|
||||
<string>GCODE</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/gcode.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>GCODE</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LISsAppleDefaultForType</key>
|
||||
<true/>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSRequiresAquaSystemAppearance</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<!-- Disable App Transport Security. Resolves https://github.com/SoftFever/OrcaSlicer/issues/791 -->
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
<key>NSAllowsArbitraryLoadsInWebContent</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
54
deps/Blosc/Blosc.cmake
vendored
@@ -6,43 +6,23 @@ else()
|
||||
set(_build_static ON)
|
||||
endif()
|
||||
|
||||
if(IS_CROSS_COMPILE AND APPLE)
|
||||
orcaslicer_add_cmake_project(Blosc
|
||||
#URL https://github.com/Blosc/c-blosc/archive/refs/tags/v1.17.0.zip
|
||||
#URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
|
||||
URL https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip
|
||||
URL_HASH SHA256=dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
# Patching upstream does not work this way with git version 2.28 installed on mac worker
|
||||
# PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DBUILD_SHARED=${_build_shared}
|
||||
-DBUILD_STATIC=${_build_static}
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_BENCHMARKS=OFF
|
||||
-DPREFER_EXTERNAL_ZLIB=ON
|
||||
-DDEACTIVATE_SSE2=ON
|
||||
-DDEACTIVATE_AVX2=ON
|
||||
)
|
||||
else()
|
||||
orcaslicer_add_cmake_project(Blosc
|
||||
#URL https://github.com/Blosc/c-blosc/archive/refs/tags/v1.17.0.zip
|
||||
#URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
|
||||
URL https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip
|
||||
URL_HASH SHA256=dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
# Patching upstream does not work this way with git version 2.28 installed on mac worker
|
||||
# PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DBUILD_SHARED=${_build_shared}
|
||||
-DBUILD_STATIC=${_build_static}
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_BENCHMARKS=OFF
|
||||
-DPREFER_EXTERNAL_ZLIB=ON
|
||||
)
|
||||
endif()
|
||||
bambustudio_add_cmake_project(Blosc
|
||||
#URL https://github.com/Blosc/c-blosc/archive/refs/tags/v1.17.0.zip
|
||||
#URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
|
||||
URL https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip
|
||||
URL_HASH SHA256=dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
# Patching upstream does not work this way with git version 2.28 installed on mac worker
|
||||
# PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DBUILD_SHARED=${_build_shared}
|
||||
-DBUILD_STATIC=${_build_static}
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_BENCHMARKS=OFF
|
||||
-DPREFER_EXTERNAL_ZLIB=ON
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_Blosc)
|
||||
endif ()
|
||||
125
deps/Boost/0001-Boost-fix.patch
vendored
@@ -1,125 +0,0 @@
|
||||
From 1d6cd7c2f8640db3cda194c1b9b82f1e4b321395 Mon Sep 17 00:00:00 2001
|
||||
From: "chunmao.guo" <chunmao.guo@bambulab.com>
|
||||
Date: Thu, 5 Jan 2023 15:55:57 +0800
|
||||
Subject: [PATCH] FIX: limit_handles
|
||||
|
||||
---
|
||||
boost/process/detail/posix/executor.hpp | 4 +++-
|
||||
boost/process/detail/posix/pipe_out.hpp | 13 +++++++++++--
|
||||
boost/process/detail/used_handles.hpp | 3 +++
|
||||
boost/process/detail/windows/handles.hpp | 10 +++++++---
|
||||
4 files changed, 24 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/boost/process/detail/posix/executor.hpp b/boost/process/detail/posix/executor.hpp
|
||||
index ca7713c..5521720 100644
|
||||
--- a/boost/process/detail/posix/executor.hpp
|
||||
+++ b/boost/process/detail/posix/executor.hpp
|
||||
@@ -325,6 +325,7 @@ public:
|
||||
}
|
||||
void set_error(const std::error_code &ec, const std::string &msg) {set_error(ec, msg.c_str());};
|
||||
|
||||
+ int error_sink() const { return _pipe_sink; }
|
||||
};
|
||||
|
||||
template<typename Sequence>
|
||||
@@ -388,6 +389,8 @@ child executor<Sequence>::invoke(boost::mpl::false_, boost::mpl::false_)
|
||||
set_error(err, "fcntl(2) failed");//this might throw, so we need to be sure our pipe is safe.
|
||||
return child();
|
||||
}
|
||||
+ _pipe_sink = p.p[1];
|
||||
+
|
||||
_ec.clear();
|
||||
boost::fusion::for_each(seq, call_on_setup(*this));
|
||||
|
||||
@@ -411,7 +414,6 @@ child executor<Sequence>::invoke(boost::mpl::false_, boost::mpl::false_)
|
||||
}
|
||||
else if (pid == 0)
|
||||
{
|
||||
- _pipe_sink = p.p[1];
|
||||
::close(p.p[0]);
|
||||
|
||||
boost::fusion::for_each(seq, call_on_exec_setup(*this));
|
||||
diff --git a/boost/process/detail/posix/pipe_out.hpp b/boost/process/detail/posix/pipe_out.hpp
|
||||
index d54cca4..a081d78 100644
|
||||
--- a/boost/process/detail/posix/pipe_out.hpp
|
||||
+++ b/boost/process/detail/posix/pipe_out.hpp
|
||||
@@ -18,7 +18,7 @@
|
||||
namespace boost { namespace process { namespace detail { namespace posix {
|
||||
|
||||
template<int p1, int p2>
|
||||
-struct pipe_out : handler_base_ext
|
||||
+struct pipe_out : handler_base_ext, ::boost::process::detail::uses_handles
|
||||
{
|
||||
int sink;
|
||||
int source; //opposite end
|
||||
@@ -30,6 +30,14 @@ struct pipe_out : handler_base_ext
|
||||
{
|
||||
p.assign_sink(-1);
|
||||
}
|
||||
+
|
||||
+ std::array<int, 4> get_used_handles()
|
||||
+ {
|
||||
+ const auto pp1 = p1 != -1 ? p1 : p2;
|
||||
+ const auto pp2 = p2 != -1 ? p2 : p1;
|
||||
+
|
||||
+ return {sink, source, pp1, pp2};
|
||||
+ }
|
||||
|
||||
template<typename Executor>
|
||||
void on_error(Executor &, const std::error_code &) const
|
||||
@@ -66,7 +74,7 @@ void pipe_out<2,-1>::on_exec_setup(Executor &e) const
|
||||
if (::dup2(sink, STDERR_FILENO) == -1)
|
||||
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
|
||||
|
||||
- if (sink != STDOUT_FILENO)
|
||||
+ if (sink != STDERR_FILENO)
|
||||
::close(sink);
|
||||
::close(source);
|
||||
}
|
||||
@@ -81,6 +89,7 @@ void pipe_out<1,2>::on_exec_setup(Executor &e) const
|
||||
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
|
||||
if ((sink != STDOUT_FILENO) && (sink != STDERR_FILENO))
|
||||
::close(sink);
|
||||
+ ::close(source);
|
||||
}
|
||||
|
||||
class async_pipe;
|
||||
diff --git a/boost/process/detail/used_handles.hpp b/boost/process/detail/used_handles.hpp
|
||||
index 4d56af3..5d71dc3 100644
|
||||
--- a/boost/process/detail/used_handles.hpp
|
||||
+++ b/boost/process/detail/used_handles.hpp
|
||||
@@ -61,6 +61,9 @@ struct foreach_handle_invocator
|
||||
template<typename Executor, typename Function>
|
||||
void foreach_used_handle(Executor &exec, Function &&func)
|
||||
{
|
||||
+#if defined(BOOST_POSIX_API)
|
||||
+ func(exec.error_sink());
|
||||
+#endif
|
||||
boost::fusion::for_each(boost::fusion::filter_if<does_use_handle<boost::mpl::_>>(exec.seq),
|
||||
foreach_handle_invocator<Function>(func));
|
||||
}
|
||||
diff --git a/boost/process/detail/windows/handles.hpp b/boost/process/detail/windows/handles.hpp
|
||||
index 7a93ac2..f120ef7 100644
|
||||
--- a/boost/process/detail/windows/handles.hpp
|
||||
+++ b/boost/process/detail/windows/handles.hpp
|
||||
@@ -139,10 +139,14 @@ struct limit_handles_ : handler_base_ext
|
||||
::boost::winapi::DWORD_ flags = 0u;
|
||||
if (itr != all_handles.end())
|
||||
*itr = ::boost::winapi::INVALID_HANDLE_VALUE_;
|
||||
- else if ((::boost::winapi::GetHandleInformation(*itr, &flags) != 0)
|
||||
- &&((flags & ::boost::winapi::HANDLE_FLAG_INHERIT_) == 0)) //it is NOT inherited anyhow, so ignore too
|
||||
- *itr = ::boost::winapi::INVALID_HANDLE_VALUE_;
|
||||
});
|
||||
+ for (auto& h : all_handles) {
|
||||
+ ::boost::winapi::DWORD_ flags = 0u;
|
||||
+ if ((h != ::boost::winapi::INVALID_HANDLE_VALUE_)
|
||||
+ && (::boost::winapi::GetHandleInformation(h, &flags) != 0)
|
||||
+ && ((flags & ::boost::winapi::HANDLE_FLAG_INHERIT_) == 0)) //it is NOT inherited anyhow, so ignore too
|
||||
+ h = ::boost::winapi::INVALID_HANDLE_VALUE_;
|
||||
+ }
|
||||
|
||||
auto part_itr = std::partition(all_handles.begin(), all_handles.end(),
|
||||
[](::boost::winapi::HANDLE_ handle) {return handle != ::boost::winapi::INVALID_HANDLE_VALUE_;});
|
||||
--
|
||||
2.36.1.windows.1
|
||||
|
||||
163
deps/Boost/Boost.cmake
vendored
@@ -1,25 +1,150 @@
|
||||
include(ExternalProject)
|
||||
|
||||
set(_context_abi_line "")
|
||||
set(_context_arch_line "")
|
||||
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
if (CMAKE_OSX_ARCHITECTURES MATCHES "x86")
|
||||
set(_context_abi_line "-DBOOST_CONTEXT_ABI:STRING=sysv")
|
||||
elseif (CMAKE_OSX_ARCHITECTURES MATCHES "arm")
|
||||
set (_context_abi_line "-DBOOST_CONTEXT_ABI:STRING=aapcs")
|
||||
if (WIN32)
|
||||
set(_bootstrap_cmd bootstrap.bat)
|
||||
set(_build_cmd b2.exe)
|
||||
else()
|
||||
set(_bootstrap_cmd ./bootstrap.sh)
|
||||
set(_build_cmd ./b2)
|
||||
endif()
|
||||
|
||||
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/common.jam ./tools/build/src/tools/common.jam)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam boost-user-config.jam)
|
||||
set(_boost_toolset gcc)
|
||||
set(_patch_command ${_patch_command} && ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/boost-user-config.jam ./tools/build/src/tools/user-config.jam)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
|
||||
if (MSVC_VERSION EQUAL 1800)
|
||||
# 1800 = VS 12.0 (v120 toolset)
|
||||
set(_boost_toolset "msvc-12.0")
|
||||
elseif (MSVC_VERSION EQUAL 1900)
|
||||
# 1900 = VS 14.0 (v140 toolset)
|
||||
set(_boost_toolset "msvc-14.0")
|
||||
elseif (MSVC_VERSION LESS 1920)
|
||||
# 1910-1919 = VS 15.0 (v141 toolset)
|
||||
set(_boost_toolset "msvc-14.1")
|
||||
elseif (MSVC_VERSION LESS 1930)
|
||||
# 1920-1929 = VS 16.0 (v142 toolset)
|
||||
set(_boost_toolset "msvc-14.2")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unsupported MSVC version")
|
||||
endif ()
|
||||
set(_context_arch_line "-DBOOST_CONTEXT_ARCHITECTURE:STRING=${CMAKE_OSX_ARCHITECTURES}")
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if (WIN32)
|
||||
set(_boost_toolset "clang-win")
|
||||
else()
|
||||
set(_boost_toolset "clang")
|
||||
endif()
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(_boost_toolset "intel")
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
set(_boost_toolset "clang")
|
||||
endif()
|
||||
|
||||
message(STATUS "Deduced boost toolset: ${_boost_toolset} based on ${CMAKE_CXX_COMPILER_ID} compiler")
|
||||
|
||||
set(_libs "")
|
||||
foreach(_comp ${DEP_Boost_COMPONENTS})
|
||||
list(APPEND _libs "--with-${_comp}")
|
||||
endforeach()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(_link shared)
|
||||
else()
|
||||
set(_link static)
|
||||
endif()
|
||||
|
||||
set(_bits "")
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
set(_bits 64)
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
set(_bits 32)
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(Boost
|
||||
URL "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz"
|
||||
URL_HASH SHA256=4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS
|
||||
-DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|stacktrace|wave|test
|
||||
-DBOOST_LOCALE_ENABLE_ICU:BOOL=OFF # do not link to libicu, breaks compatibility between distros
|
||||
-DBUILD_TESTING:BOOL=OFF
|
||||
"${_context_abi_line}"
|
||||
"${_context_arch_line}"
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NPROC)
|
||||
file(TO_NATIVE_PATH ${DESTDIR}/usr/local/ _prefix)
|
||||
|
||||
set(_boost_flags "")
|
||||
if (UNIX)
|
||||
set(_boost_flags "cflags=-fPIC;cxxflags=-fPIC")
|
||||
elseif(APPLE)
|
||||
set(_boost_flags
|
||||
"cflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"cxxflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"mflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"mmflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}")
|
||||
endif()
|
||||
|
||||
set(_boost_variants "")
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
list(APPEND CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
|
||||
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
|
||||
endif()
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "Release" _cfg_rel)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" _cfg_relwdeb)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "MinSizeRel" _cfg_minsizerel)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _cfg_deb)
|
||||
|
||||
if (_cfg_rel GREATER -1 OR _cfg_relwdeb GREATER -1 OR _cfg_minsizerel GREATER -1)
|
||||
list(APPEND _boost_variants release)
|
||||
endif()
|
||||
|
||||
if (_cfg_deb GREATER -1 OR (MSVC AND ${DEP_DEBUG}) )
|
||||
list(APPEND _boost_variants debug)
|
||||
endif()
|
||||
|
||||
if (NOT _boost_variants)
|
||||
set(_boost_variants release)
|
||||
endif()
|
||||
|
||||
set(_build_cmd ${_build_cmd}
|
||||
${_boost_flags}
|
||||
-j${NPROC}
|
||||
${_libs}
|
||||
--layout=versioned
|
||||
--debug-configuration
|
||||
toolset=${_boost_toolset}
|
||||
address-model=${_bits}
|
||||
link=${_link}
|
||||
threading=multi
|
||||
boost.locale.icu=off
|
||||
--disable-icu
|
||||
${_boost_variants}
|
||||
stage)
|
||||
|
||||
set(_install_cmd ${_build_cmd} --prefix=${_prefix} install)
|
||||
|
||||
ExternalProject_Add(
|
||||
dep_Boost
|
||||
URL "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz"
|
||||
URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost
|
||||
CONFIGURE_COMMAND "${_bootstrap_cmd}"
|
||||
PATCH_COMMAND ${_patch_command}
|
||||
BUILD_COMMAND "${_build_cmd}"
|
||||
BUILD_IN_SOURCE ON
|
||||
INSTALL_COMMAND "${_install_cmd}"
|
||||
)
|
||||
|
||||
set(DEP_Boost_DEPENDS ZLIB)
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
# Patch the boost::polygon library with a custom one.
|
||||
ExternalProject_Add(dep_boost_polygon
|
||||
EXCLUDE_FROM_ALL ON
|
||||
# GIT_REPOSITORY "https://github.com/prusa3d/polygon"
|
||||
# GIT_TAG prusaslicer_gmp
|
||||
URL https://github.com/prusa3d/polygon/archive/refs/heads/prusaslicer_gmp.zip
|
||||
URL_HASH SHA256=abeb9710f0a7069fb9b22181ae5c56f6066002f125db210e7ffb27032aed6824
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/boost_polygon
|
||||
DEPENDS dep_Boost
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon"
|
||||
"${DESTDIR}/usr/local/include/boost/polygon"
|
||||
)
|
||||
# Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms.
|
||||
list(APPEND _dep_list "dep_boost_polygon")
|
||||
endif ()
|
||||
30
deps/CGAL/CGAL.cmake
vendored
@@ -1,11 +1,31 @@
|
||||
orcaslicer_add_cmake_project(
|
||||
bambustudio_add_cmake_project(
|
||||
CGAL
|
||||
# GIT_REPOSITORY https://github.com/CGAL/cgal.git
|
||||
# GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0
|
||||
GIT_REPOSITORY https://github.com/CGAL/cgal.git
|
||||
GIT_TAG caacd806dc55c61cc68adaad99f2240f00493b29 # releases/CGAL-5.3
|
||||
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
|
||||
URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
|
||||
URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
|
||||
#URL https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip
|
||||
#URL_HASH SHA256=c2b035bd078687b6d8c0fb6371a7443adcdb647856af9969532c4050cd5f48e5
|
||||
DEPENDS dep_Boost dep_GMP dep_MPFR
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# CGAL, for whatever reason, makes itself non-relocatable by writing the build directory into
|
||||
# CGALConfig-installation-dirs.cmake and including it in configure time.
|
||||
# If this file is not present, it will not consider the stored absolute path
|
||||
ExternalProject_Add_Step(dep_CGAL dep_CGAL_relocation_fix
|
||||
DEPENDEES install
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E remove CGALConfig-installation-dirs.cmake
|
||||
WORKING_DIRECTORY "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/CGAL"
|
||||
)
|
||||
|
||||
# Again, for whatever reason, CGAL thinks that its version is not relevant if
|
||||
# configured as a header only library. Fixing it by placing a cmake version file
|
||||
# besides the installed config file.
|
||||
ExternalProject_Add_Step(dep_CGAL dep_CGAL_version_fix
|
||||
DEPENDEES install
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy cgal/CGALConfigVersion.cmake "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/CGAL/CGALConfigVersion.cmake"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}"
|
||||
)
|
||||
|
||||
219
deps/CMakeLists.txt
vendored
@@ -1,12 +1,12 @@
|
||||
#
|
||||
# This CMake project downloads, configures and builds OrcaSlicer dependencies on Unix and Windows.
|
||||
# This CMake project downloads, configures and builds BambuStudio dependencies on Unix and Windows.
|
||||
#
|
||||
# When using this script, it's recommended to perform an out-of-source build using CMake.
|
||||
#
|
||||
# All the dependencies are installed in a `destdir` directory in the root of the build directory,
|
||||
# in a traditional Unix-style prefix structure. The destdir can be used directly by CMake
|
||||
# when building OrcaSlicer - to do this, set the CMAKE_PREFIX_PATH to ${destdir}/usr/local.
|
||||
# Warning: On UNIX/Linux, you also need to set -DSLIC3R_STATIC=1 when building OrcaSlicer.
|
||||
# when building BambuStudio - to do this, set the CMAKE_PREFIX_PATH to ${destdir}/usr/local.
|
||||
# Warning: On UNIX/Linux, you also need to set -DSLIC3R_STATIC=1 when building BambuStudio.
|
||||
#
|
||||
# For better clarity of console output, it's recommended to _not_ use a parallelized build
|
||||
# for the top-level command, ie. use `make -j 1` or `ninja -j 1` to force single-threaded top-level
|
||||
@@ -20,21 +20,8 @@
|
||||
# therefore, unfortunatelly, the installation cannot be copied/moved elsewhere without re-installing wxWidgets.
|
||||
#
|
||||
|
||||
project(BambuStudio-deps)
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
if (APPLE)
|
||||
# if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3
|
||||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||
endif ()
|
||||
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
|
||||
endif ()
|
||||
|
||||
if(POLICY CMP0135) # DOWNLOAD_EXTRACT_TIMESTAMP
|
||||
cmake_policy(SET CMP0135 NEW)
|
||||
endif()
|
||||
|
||||
project(OrcaSlicer-deps)
|
||||
|
||||
include(ExternalProject)
|
||||
include(ProcessorCount)
|
||||
@@ -45,72 +32,42 @@ if (NPROC EQUAL 0)
|
||||
endif ()
|
||||
|
||||
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
|
||||
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/../DL_CACHE CACHE PATH "Path for downloaded source packages.")
|
||||
set(FLATPAK FALSE CACHE BOOL "Toggles various build settings for flatpak, like /usr/local in DESTDIR or not building wxwidgets")
|
||||
if (NOT FLATPAK)
|
||||
set(DESTDIR "${DESTDIR}/usr/local/")
|
||||
endif()
|
||||
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Path for downloaded source packages.")
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
if (_is_multi)
|
||||
option(DEP_DEBUG "Build debug variants (only applicable on Windows)" OFF)
|
||||
option(ORCA_INCLUDE_DEBUG_INFO "Includes debug information in a release build (like RelWithDebInfo) in a way that works with multi-configuration generators and incompatible dependencies. DEP_DEBUG option takes priority over this." OFF)
|
||||
endif ()
|
||||
option(DEP_DEBUG "Build debug variants (only applicable on Windows)" ON)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
|
||||
endif()
|
||||
|
||||
set(IS_CROSS_COMPILE FALSE)
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
set(CMAKE_FIND_APPBUNDLE LAST)
|
||||
list(FIND CMAKE_OSX_ARCHITECTURES ${CMAKE_SYSTEM_PROCESSOR} _arch_idx)
|
||||
message(STATUS "prusaslicer_add_cmake_project for Apple")
|
||||
if (CMAKE_OSX_ARCHITECTURES AND _arch_idx LESS 0)
|
||||
message(STATUS "prusaslicer_add_cmake_project for Apple crosscompiling")
|
||||
set(IS_CROSS_COMPILE TRUE)
|
||||
set(CMAKE_CXX_COMPILER_ID "Clang")
|
||||
string(REPLACE ";" "$<SEMICOLON>" CMAKE_OSX_ARCHS "${CMAKE_OSX_ARCHITECTURES}")
|
||||
set(_cmake_osx_arch -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHS})
|
||||
set(_cmake_args_osx_arch CMAKE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHS})
|
||||
message(STATUS "Detect Cross-compilation. Will build for target ${CMAKE_OSX_ARCHS}" )
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
# On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL.
|
||||
# FIXME:
|
||||
# Enabling this option is not safe. IGL will compile itself with its own version of Eigen while
|
||||
# Slic3r compiles with a different version which will cause runtime errors.
|
||||
# option(DEP_BUILD_IGL_STATIC "Build IGL as a static library. Might cause link errors and increase binary size." OFF)
|
||||
|
||||
message(STATUS "OrcaSlicer deps DESTDIR: ${DESTDIR}")
|
||||
message(STATUS "OrcaSlicer dowload dir for source packages: ${DEP_DOWNLOAD_DIR}")
|
||||
message(STATUS "OrcaSlicer deps debug build: ${DEP_DEBUG}")
|
||||
message(STATUS "BambuStudio deps DESTDIR: ${DESTDIR}")
|
||||
message(STATUS "BambuStudio dowload dir for source packages: ${DEP_DOWNLOAD_DIR}")
|
||||
message(STATUS "BambuStudio deps debug build: ${DEP_DEBUG}")
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
# The default command line for patching. Only works for newer
|
||||
set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix)
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.")
|
||||
endif ()
|
||||
|
||||
function(orcaslicer_add_cmake_project projectname)
|
||||
function(bambustudio_add_cmake_project projectname)
|
||||
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
|
||||
|
||||
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
||||
if (_is_multi OR MSVC)
|
||||
if (ORCA_INCLUDE_DEBUG_INFO AND NOT DEP_DEBUG)
|
||||
set(_configs_line "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO} -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
else ()
|
||||
set(_configs_line "")
|
||||
endif ()
|
||||
set(_configs_line "")
|
||||
endif ()
|
||||
|
||||
set(_gen "")
|
||||
@@ -120,23 +77,21 @@ function(orcaslicer_add_cmake_project projectname)
|
||||
set(_build_j "/m")
|
||||
endif ()
|
||||
|
||||
if (NOT IS_CROSS_COMPILE OR NOT APPLE)
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
INSTALL_DIR ${DESTDIR}
|
||||
INSTALL_DIR ${DESTDIR}/usr/local
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
|
||||
${_gen}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_DEBUG_POSTFIX:STRING=d
|
||||
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
${_cmake_osx_arch}
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
@@ -144,62 +99,8 @@ if (NOT IS_CROSS_COMPILE OR NOT APPLE)
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
elseif(FLATPAK)
|
||||
# the only reason this is here is because of the HACK at the bottom for ci
|
||||
#
|
||||
# note for future devs: shared libs may actually create a size reduction
|
||||
# but orcaslicer_deps tends to get really funny regarding linking after that (notably boost)
|
||||
# so, as much as I would like to use that, it's not happening
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
INSTALL_DIR ${DESTDIR}
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
|
||||
${_gen}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
|
||||
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
|
||||
-DCMAKE_DEBUG_POSTFIX:STRING=d
|
||||
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
${_cmake_osx_arch}
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
# HACK: save space after each compile job, because CI
|
||||
# reasoning: cmake changes directory after this command, so just keep only the folders
|
||||
# so that it can navigate out
|
||||
COMMAND find "${CMAKE_BINARY_DIR}/dep_${projectname}-prefix/" -type f -delete
|
||||
)
|
||||
else()
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
INSTALL_DIR ${DESTDIR}
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
|
||||
${_gen}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
${_cmake_osx_arch}
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
endfunction(orcaslicer_add_cmake_project)
|
||||
endfunction(bambustudio_add_cmake_project)
|
||||
|
||||
|
||||
if (MSVC)
|
||||
@@ -240,20 +141,6 @@ else()
|
||||
include("deps-linux.cmake")
|
||||
endif()
|
||||
|
||||
if(FLATPAK)
|
||||
# flatpak bundles some deps with the layer, so attempt to find them first
|
||||
# also, yes, this reduces CI by not needing to vendor certain deps
|
||||
find_package(ZLIB)
|
||||
find_package(PNG)
|
||||
find_package(EXPAT)
|
||||
find_package(CURL)
|
||||
find_package(JPEG)
|
||||
find_package(TIFF)
|
||||
find_package(Freetype)
|
||||
find_package(OpenSSL 1.1...<3.2)
|
||||
find_package(CURL)
|
||||
endif()
|
||||
|
||||
set(ZLIB_PKG "")
|
||||
if (NOT ZLIB_FOUND)
|
||||
include(ZLIB/ZLIB.cmake)
|
||||
@@ -265,7 +152,6 @@ if (NOT PNG_FOUND)
|
||||
set(PNG_PKG dep_PNG)
|
||||
endif ()
|
||||
set(EXPAT_PKG "")
|
||||
find_package(EXPAT)
|
||||
if (NOT EXPAT_FOUND)
|
||||
include(EXPAT/EXPAT.cmake)
|
||||
set(EXPAT_PKG dep_EXPAT)
|
||||
@@ -278,7 +164,6 @@ include(Boost/Boost.cmake)
|
||||
include(Cereal/Cereal.cmake)
|
||||
include(Qhull/Qhull.cmake)
|
||||
include(GLEW/GLEW.cmake)
|
||||
|
||||
include(GLFW/GLFW.cmake)
|
||||
include(OpenCSG/OpenCSG.cmake)
|
||||
|
||||
@@ -293,89 +178,35 @@ include(MPFR/MPFR.cmake)
|
||||
include(CGAL/CGAL.cmake)
|
||||
|
||||
include(NLopt/NLopt.cmake)
|
||||
include(libnoise/libnoise.cmake)
|
||||
|
||||
include(OpenSSL/OpenSSL.cmake)
|
||||
|
||||
# I *think* 1.1 is used for *just* md5 hashing?
|
||||
# 3.1 has everything in the right place, but the md5 funcs used are deprecated
|
||||
# a grep across the repo shows it is used for other things
|
||||
# TODO: update openssl and everything that uses <openssl/md5.h>
|
||||
set(OPENSSL_PKG "")
|
||||
if(NOT OPENSSL_FOUND)
|
||||
include(OpenSSL/OpenSSL.cmake)
|
||||
set(OPENSSL_PKG dep_OpenSSL)
|
||||
endif()
|
||||
|
||||
# we don't want to load a "wrong" openssl when loading curl
|
||||
# so, just don't even bother
|
||||
# ...i think this is how it works? change if wrong
|
||||
set(CURL_PKG "")
|
||||
if (NOT OPENSSL_FOUND OR NOT CURL_FOUND)
|
||||
if (NOT CURL_FOUND)
|
||||
include(CURL/CURL.cmake)
|
||||
set(CURL_PKG dep_CURL)
|
||||
endif ()
|
||||
|
||||
set(JPEG_PKG "")
|
||||
if (NOT JPEG_FOUND)
|
||||
include(JPEG/JPEG.cmake)
|
||||
set(JPEG_PKG dep_JPEG)
|
||||
endif()
|
||||
|
||||
set(TIFF_PKG "")
|
||||
if (NOT TIFF_FOUND)
|
||||
include(TIFF/TIFF.cmake)
|
||||
set(TIFF_PKG "dep_TIFF")
|
||||
endif()
|
||||
|
||||
# flatpak builds wxwidgets separately
|
||||
set(WXWIDGETS_PKG "")
|
||||
if (NOT FLATPAK)
|
||||
include(wxWidgets/wxWidgets.cmake)
|
||||
set(WXWIDGETS_PKG "dep_wxWidgets")
|
||||
endif()
|
||||
|
||||
set(FREETYPE_PKG "")
|
||||
if(NOT FREETYPE_FOUND)
|
||||
include(FREETYPE/FREETYPE.cmake)
|
||||
set(FREETYPE_PKG "dep_FREETYPE")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
|
||||
RESULT_VARIABLE REV_PARSE_RESULT
|
||||
OUTPUT_VARIABLE REV_PARSE_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Will output "true" and have a 0 return code if within a git repo
|
||||
if((REV_PARSE_RESULT EQUAL 0) AND (REV_PARSE_OUTPUT STREQUAL "true"))
|
||||
set(IN_GIT_REPO TRUE)
|
||||
# Find relative path from root to source used for adjusting patch command
|
||||
file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
|
||||
endif ()
|
||||
|
||||
include(JPEG/JPEG.cmake)
|
||||
include(TIFF/TIFF.cmake)
|
||||
include(wxWidgets/wxWidgets.cmake)
|
||||
include(OCCT/OCCT.cmake)
|
||||
include(OpenCV/OpenCV.cmake)
|
||||
|
||||
set(_dep_list
|
||||
dep_Boost
|
||||
dep_TBB
|
||||
${OPENSSL_PKG}
|
||||
${CURL_PKG}
|
||||
${WXWIDGETS_PKG}
|
||||
dep_wxWidgets
|
||||
dep_Cereal
|
||||
dep_NLopt
|
||||
dep_OpenVDB
|
||||
dep_OpenCSG
|
||||
dep_OpenCV
|
||||
dep_CGAL
|
||||
dep_OpenSSL
|
||||
dep_GLFW
|
||||
dep_OCCT
|
||||
${FREETYPE_PKG}
|
||||
${PNG_PKG}
|
||||
${ZLIB_PKG}
|
||||
${EXPAT_PKG}
|
||||
dep_libnoise
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
@@ -387,6 +218,8 @@ else()
|
||||
#list(APPEND _dep_list "dep_libigl")
|
||||
endif()
|
||||
|
||||
list(APPEND _dep_list "dep_OCCT")
|
||||
|
||||
add_custom_target(deps ALL DEPENDS ${_dep_list})
|
||||
|
||||
# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands
|
||||
|
||||
17
deps/CURL/CURL.cmake
vendored
@@ -25,15 +25,14 @@ set(_curl_platform_flags
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
#set(_curl_platform_flags ${_curl_platform_flags} -DCMAKE_USE_SCHANNEL=ON)
|
||||
set(_curl_platform_flags ${_curl_platform_flags} -DCMAKE_USE_OPENSSL=ON -DCURL_CA_PATH:STRING=none)
|
||||
set(_curl_platform_flags ${_curl_platform_flags} -DCMAKE_USE_SCHANNEL=ON)
|
||||
elseif (APPLE)
|
||||
set(_curl_platform_flags
|
||||
|
||||
${_curl_platform_flags}
|
||||
|
||||
#-DCMAKE_USE_SECTRANSP:BOOL=ON
|
||||
-DCMAKE_USE_OPENSSL:BOOL=ON
|
||||
-DCMAKE_USE_SECTRANSP:BOOL=ON
|
||||
-DCMAKE_USE_OPENSSL:BOOL=OFF
|
||||
|
||||
-DCURL_CA_PATH:STRING=none
|
||||
)
|
||||
@@ -56,7 +55,7 @@ else()
|
||||
set(_curl_static ON)
|
||||
endif()
|
||||
|
||||
orcaslicer_add_cmake_project(CURL
|
||||
bambustudio_add_cmake_project(CURL
|
||||
# GIT_REPOSITORY https://github.com/curl/curl.git
|
||||
# GIT_TAG curl-7_75_0
|
||||
URL https://github.com/curl/curl/archive/refs/tags/curl-7_75_0.zip
|
||||
@@ -66,16 +65,14 @@ orcaslicer_add_cmake_project(CURL
|
||||
# ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/curl-mods.patch
|
||||
CMAKE_ARGS
|
||||
-DBUILD_TESTING:BOOL=OFF
|
||||
-DBUILD_CURL_EXE:BOOL=OFF
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCURL_STATICLIB=${_curl_static}
|
||||
${_curl_platform_flags}
|
||||
)
|
||||
|
||||
if(NOT OPENSSL_FOUND)
|
||||
# (openssl may or may not be built)
|
||||
add_dependencies(dep_CURL ${OPENSSL_PKG})
|
||||
endif()
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
add_dependencies(dep_CURL dep_OpenSSL)
|
||||
endif ()
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_CURL)
|
||||
|
||||