Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature_configurable_…
Browse files Browse the repository at this point in the history
…short_wall_cleaning
  • Loading branch information
scottmudge committed Dec 28, 2023
2 parents 9f128e4 + a96ed26 commit ce51d63
Show file tree
Hide file tree
Showing 1,367 changed files with 254,776 additions and 146,499 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ PenaltyBreakString: 600
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 50
PenaltyReturnTypeOnItsOwnLine: 300
PointerAlignment: Right
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: false
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- release/*
paths:
- 'deps/**'
- 'src/**'
Expand All @@ -16,6 +17,7 @@ on:
pull_request:
branches:
- main
- release/*
paths:
- 'deps/**'
- 'src/**'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ jobs:
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 -dp -a ${{ inputs.arch }}
brew install zstd
- name: Build on Ubuntu
if: inputs.os == 'ubuntu-20.04'
Expand Down
71 changes: 46 additions & 25 deletions .github/workflows/build_orca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,43 @@ jobs:
- name: Get the version and date on Ubuntu and macOS
if: inputs.os != 'windows-latest'
run: |
ver=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
ver="nightly$(date +'%y%m%d')"
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR${{ github.event.number }}"
else
ver=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
ver=V$ver
fi
echo "ver=$ver" >> $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: |
echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
# Extract the version from the file
$versionContent = Get-Content version.inc -Raw
if ($versionContent -match 'set\(SoftFever_VERSION "(.*?)"\)') {
$ver = $matches[1]
$date = Get-Date -Format 'yyyyMMdd'
$ref = "${{ github.ref }}"
$eventName = "${{ github.event_name }}"
$prNumber = "${{ github.event.number }}"
if ($ref -eq 'refs/heads/main') {
$ver = "nightly" + $date.Substring(2)
} elseif ($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: ${{ env.date }} version: $ver"
echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "date: ${{ env.date }} version: ${{ env.ver }}"
shell: pwsh

- name: load cached deps
uses: actions/cache@v3
with:
Expand All @@ -57,9 +76,11 @@ jobs:
- name: Install tools mac
if: inputs.os == 'macos-12'
run: |
brew install cmake git gettext zstd tree
brew install cmake git gettext tree
brew list
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
tree ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
- name: Build slicer mac
if: inputs.os == 'macos-12'
Expand All @@ -69,7 +90,7 @@ jobs:
# Thanks to RaySajuuk, it's working now
- name: Sign app and notary
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-12'
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'macos-12'
working-directory: ${{ github.workspace }}
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
Expand All @@ -88,25 +109,25 @@ jobs:
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}}_V${{ env.ver }}.dmg
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_${{inputs.arch}}_V${{ env.ver }}.dmg
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}}_V${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait
xcrun stapler staple OrcaSlicer_Mac_${{inputs.arch}}_V${{ env.ver }}.dmg
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-12'
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}}_V${{ env.ver }}.dmg
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-12'
uses: actions/upload-artifact@v3
with:
name: OrcaSlicer_Mac_${{inputs.arch}}_V${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_V${{ env.ver }}.dmg
name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg

# Windows
- name: setup MSVC
Expand Down Expand Up @@ -134,34 +155,34 @@ jobs:
if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }}/build
shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip OrcaSlicer_Windows_V${{ env.ver }}_portable.zip ${{ github.workspace }}/build/OrcaSlicer'
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_V${{ env.ver }}_for_developers_only.7z *.pdb'
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@v3
with:
name: OrcaSlicer_Windows_V${{ env.ver }}_portable
path: ${{ github.workspace }}/build/OrcaSlicer_Windows_V${{ env.ver }}_portable.zip
name: OrcaSlicer_Windows_${{ env.ver }}_portable
path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip

- name: Upload artifacts Win installer
if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: OrcaSlicer_Windows_V${{ env.ver }}
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@v3
with:
name: PDB
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_V${{ env.ver }}_for_developers_only.7z
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z

# Ubuntu
- name: Install dependencies
Expand Down Expand Up @@ -195,5 +216,5 @@ jobs:
if: inputs.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: OrcaSlicer_Linux_V${{ env.ver }}
path: './build/OrcaSlicer_ubu64.AppImage'
name: OrcaSlicer_Linux_${{ env.ver }}
path: './build/OrcaSlicer_ubu64.AppImage'
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ SVG
src/OrcaSlicer-doc/
.idea/
/.cache/
*.mo
*.mo
**/process_full/
**/machine_full/
**/filament_full/
/deps/DL_CACHE/
3 changes: 2 additions & 1 deletion BuildLinux.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash
set -e # exit on first error

export ROOT=`pwd`
export NCORES=`nproc --all`
export CMAKE_BUILD_PARALLEL_LEVEL=${NCORES}
FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2)
FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3)

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
Expand Down
22 changes: 17 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ if (APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version" FORCE)
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
Expand Down Expand Up @@ -332,6 +333,16 @@ 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}")
Expand Down Expand Up @@ -426,11 +437,8 @@ 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)
Expand Down Expand Up @@ -499,6 +507,8 @@ 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)
Expand All @@ -511,9 +521,11 @@ find_package(glfw3 REQUIRED)

# Find the Cereal serialization library
find_package(cereal REQUIRED)
set_target_properties(cereal PROPERTIES IMPORTED_GLOBAL TRUE)
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
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Build OrcaSlicer](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_orca.yml/badge.svg?branch=main)](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_orca.yml)

[![Build all](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_all.yml/badge.svg?branch=main)](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_all.yml)
# Orca Slicer
Orca Slicer is an open source slicer for FDM printers.
You can download Orca Slicer here: [github releases page](https://github.com/SoftFever/OrcaSlicer/releases/).
Expand All @@ -8,7 +7,7 @@ You can download Orca Slicer here: [github releases page](https://github.com/Sof
# Main features
- Auto calibrations for all printers
- Sandwich(inner-outer-inner) mode - an improved version of the `External perimeters first` mode
- Precise wall
- [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
Expand All @@ -31,9 +30,9 @@ Orca Slicer's logo is designed by community member Justin Levine(@freejstnalxndr
**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 following instructions bellow*
3. *If you want to run a build from a PR, you also need following instructions below*
<details quarantine>
- Option 1 (You only need to do this once. After that the app can be oppened normally.):
- 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_

Expand All @@ -58,7 +57,7 @@ Orca Slicer's logo is designed by community member Justin Levine(@freejstnalxndr
- Run `build_release.bat` in `x64 Native Tools Command Prompt for VS 2019`

- Mac 64-bit
- Tools needed: Xcode, Cmake, git, gettext
- Tools needed: Xcode, Cmake, git, gettext, libtool, automake, autoconf
- run `build_release_macos.sh`

- Ubuntu
Expand Down
25 changes: 13 additions & 12 deletions build_release_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ fi
echo "Arch: $ARCH"
echo "BUILD_TARGET: $BUILD_TARGET"

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
# 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


WD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $WD/deps
Expand Down
10 changes: 0 additions & 10 deletions cmake/modules/FindGLEW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ 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)
Expand Down
Loading

0 comments on commit ce51d63

Please sign in to comment.