Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleStrike committed Feb 25, 2025
2 parents 193130e + e173479 commit 7841aa5
Show file tree
Hide file tree
Showing 379 changed files with 63,889 additions and 5,892 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ PenaltyBreakString: 600
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 50
PenaltyReturnTypeOnItsOwnLine: 300
PenaltyIndentedWhitespace: 10
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_flatpak_asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ jobs:
secrets: inherit
with:
with_asan: true
debug_symbols: true
actions_branch: master
11 changes: 11 additions & 0 deletions .github/workflows/build_nogui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Build without GUI

on:
workflow_dispatch:

jobs:
build_nogui:
uses: Prusa-Development/PrusaSlicer-Actions/.github/workflows/build_nogui.yml@master
secrets: inherit
with:
actions_branch: master
6 changes: 0 additions & 6 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ on:
- cron: "0 0 * * *"

jobs:
static_analysis_master:
uses: Prusa-Development/PrusaSlicer-Actions/.github/workflows/static_analysis.yml@master
secrets: inherit
with:
branch: master
actions_branch: master
static_analysis_dev:
uses: Prusa-Development/PrusaSlicer-Actions/.github/workflows/static_analysis.yml@master
secrets: inherit
Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ if(SLIC3R_BUILD_TESTS)
endif()


# Resources install target, configure fhs.hpp on UNIX
if (WIN32)
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
elseif (SLIC3R_FHS)
Expand All @@ -646,10 +645,9 @@ elseif (SLIC3R_FHS)
)
endforeach()
install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/udev/ DESTINATION lib/udev/rules.d)
target_compile_definitions(PrusaSlicer PUBLIC SLIC3R_FHS SLIC3R_FHS_RESOURCES="${SLIC3R_FHS_RESOURCES}")
else ()
install(FILES src/platform/unix/PrusaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
install(FILES src/platform/unix/PrusaGcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
endif ()

configure_file(src/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/platform/unix/fhs.hpp)
3 changes: 3 additions & 0 deletions bundled_deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ target_include_directories(ankerl INTERFACE ankerl)
add_library(stb_dxt INTERFACE)
target_include_directories(stb_dxt INTERFACE stb_dxt)

add_library(stb_image INTERFACE)
target_include_directories(stb_image INTERFACE stb_image)

add_library(tcbspan INTERFACE)
target_include_directories(tcbspan INTERFACE tcbspan)

Expand Down
10,601 changes: 10,601 additions & 0 deletions bundled_deps/stb_image/stb_image_resize2.h

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/+Boost/Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ add_cmake_project(Boost
-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
-DBOOST_IOSTREAMS_ENABLE_ZSTD:BOOL=OFF
"${_context_abi_line}"
"${_context_arch_line}"
)
Expand Down
5 changes: 3 additions & 2 deletions deps/+Catch2/Catch2.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
add_cmake_project(Catch2
URL "https://github.com/catchorg/Catch2/archive/refs/tags/v2.13.10.zip"
URL_HASH SHA256=121e7488912c2ce887bfe4699ebfb983d0f2e0d68bcd60434cdfd6bb0cf78b43
URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.8.0.zip"
URL_HASH SHA256=bffd2c45a84e5a4b0c17e695798e8d2f65931cbaf5c7556d40388d1d8d04eb83
CMAKE_ARGS
-DCATCH_BUILD_TESTING:BOOL=OFF
-DCMAKE_CXX_STANDARD=17
)
48 changes: 25 additions & 23 deletions deps/+PNG/PNG.cmake
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
if (APPLE)
# Only disable NEON extension for Apple ARM builds, leave it enabled for Raspberry PI.
set(_disable_neon_extension "-DPNG_ARM_NEON:STRING=off")
else ()
set(_disable_neon_extension "")
endif ()
if (MSVC OR APPLE)
if (APPLE)
# Only disable NEON extension for Apple ARM builds, leave it enabled for Raspberry PI.
set(_disable_neon_extension "-DPNG_ARM_NEON:STRING=off")
else ()
set(_disable_neon_extension "")
endif ()

set(_patch_cmd PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.patched CMakeLists.txt)
set(_patch_cmd PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.patched CMakeLists.txt)

if (APPLE)
set(_patch_cmd ${_patch_cmd} && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch)
endif ()
if (APPLE)
set(_patch_cmd ${_patch_cmd} && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch)
endif ()

add_cmake_project(PNG
URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip
URL_HASH SHA256=3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f
PATCH_COMMAND "${_patch_cmd}"
CMAKE_ARGS
-DPNG_SHARED=OFF
-DPNG_STATIC=ON
-DPNG_PREFIX=prusaslicer_
-DPNG_TESTS=OFF
-DPNG_EXECUTABLES=OFF
${_disable_neon_extension}
)
add_cmake_project(PNG
URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip
URL_HASH SHA256=3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f
PATCH_COMMAND "${_patch_cmd}"
CMAKE_ARGS
-DPNG_SHARED=OFF
-DPNG_STATIC=ON
-DPNG_PREFIX=prusaslicer_
-DPNG_TESTS=OFF
-DPNG_EXECUTABLES=OFF
${_disable_neon_extension}
)

set(DEP_PNG_DEPENDS ZLIB)
set(DEP_PNG_DEPENDS ZLIB)
endif()
15 changes: 0 additions & 15 deletions deps/+wxWidgets/webview.patch

This file was deleted.

45 changes: 45 additions & 0 deletions deps/+wxWidgets/wx-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --color -urN wxWidgets-323a465e577e03f330e2e6a4c78e564d125340cb/build/cmake/lib/webview/CMakeLists.txt dep_wxWidgets/build/cmake/lib/webview/CMakeLists.txt
--- wxWidgets-323a465e577e03f330e2e6a4c78e564d125340cb/src/osx/carbon/dcscreen.cpp 2024-06-26 10:39:50.000000000 +0200
+++ dep_wxWidgets/src/osx/carbon/dcscreen.cpp 2025-01-08 14:13:51.980634573 +0100
@@ -14,6 +14,7 @@
#include "wx/osx/dcscreen.h"

#include "wx/osx/private.h"
+#include "wx/osx/private/available.h"
#include "wx/graphics.h"

wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl);
@@ -68,15 +69,26 @@
if ( subrect )
srcRect = CGRectOffset( srcRect, -subrect->x, -subrect->y ) ;

- CGImageRef image = NULL;
-
- image = CGDisplayCreateImage(kCGDirectMainDisplay);
+ CGImageRef image = nullptr;

- wxASSERT_MSG(image, wxT("wxScreenDC::GetAsBitmap - unable to get screenshot."));
-
- CGContextDrawImage(context, srcRect, image);
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 140000
+ if ( WX_IS_MACOS_AVAILABLE(14, 4) ) // errors on lower versions of macOS 14
+ {
+ // TODO add ScreenKit implementation
+ }
+ else
+#endif // macOS 10.14+
+ {
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < 150000
+ image = CGDisplayCreateImage(kCGDirectMainDisplay);
+#endif
+ }

- CGImageRelease(image);
+ if ( image != nullptr )
+ {
+ CGContextDrawImage(context, srcRect, image);
+ CGImageRelease(image);
+ }

CGContextRestoreGState(context);
#else
6 changes: 3 additions & 3 deletions deps/+wxWidgets/wxWidgets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ else ()
endif ()

add_cmake_project(wxWidgets
URL https://github.com/prusa3d/wxWidgets/archive/323a465e577e03f330e2e6a4c78e564d125340cb.zip
URL_HASH SHA256=B538E4AD3CC93117932F4DED70C476D6650F9C70A9D4055A08F3693864C47465
PATCH_COMMAND COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/webview.patch
URL https://github.com/prusa3d/wxWidgets/archive/5462e7d7cfac645926188443e842171e107b312c.zip
URL_HASH SHA256=3EBB971DDB45CEEA6D9B965C3D0266F44EDAE71F2A7DAA5D48DB34BD95AA878B
PATCH_COMMAND COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/wx-fixes.patch
CMAKE_ARGS
"-DCMAKE_DEBUG_POSTFIX:STRING="
-DwxBUILD_PRECOMP=ON
Expand Down
15 changes: 15 additions & 0 deletions deps/+z3/z3.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
add_cmake_project(z3
URL https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.13.0.zip
URL_HASH SHA256=81543736dcbbbcb037a7df55d0be596245d509f3f69f56610df32728e48ee050
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DZ3_INCLUDE_GIT_HASH=OFF
-DZ3_INCLUDE_GIT_DESCRIBE=OFF
-DZ3_USE_LIB_GMP=OFF
-DZ3_BUILD_LIBZ3_SHARED=OFF
-DZ3_ENABLE_EXAMPLE_TARGETS=OFF
-DZ3_ALWAYS_BUILD_DOCS=OFF
-DZ3_BUILD_EXECUTABLE=OFF
-DZ3_BUILD_TEST_EXECUTABLES=OFF
)

19 changes: 19 additions & 0 deletions doc/How to build - Linux et al.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,27 @@ And that's it. It is now possible to run the freshly built PrusaSlicer binary:
cd src
./prusa-slicer

#### 4. Running Unit Tests

For the most complete unit testing, use the Debug build option `-DCMAKE_BUILD_TYPE=Debug` when running cmake.
Without the Debug build, internal assert statements are not tested.

To run the unit tests:

cd build
make test

To run a specific unit test:

cd build/tests/

The unit tests can be found by

`ls */*_tests`

Any of these unit tests can be run directly e.g.

`./fff_print/fff_print_tests`

## Useful CMake flags when building dependencies

Expand Down
22 changes: 22 additions & 0 deletions doc/How to build - Mac OS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,28 @@ Alternatively, if you would like to use XCode GUI, modify the `cmake` command to
and then open the `PrusaSlicer.xcodeproj` file.
This should open up XCode where you can perform build using the GUI or perform other tasks.

### Running Unit Tests

For the most complete unit testing, use the Debug build option `-DCMAKE_BUILD_TYPE=Debug` when running cmake.
Without the Debug build, internal assert statements are not tested.

To run all the unit tests:

cd build
make test

To run a specific unit test:

cd build/tests/

The unit tests can be found by

`ls */*_tests`

Any of these unit tests can be run directly e.g.

`./fff_print/fff_print_tests`

### Note on Mac OS X SDKs

By default PrusaSlicer builds against whichever SDK is the default on the current system.
Expand Down
20 changes: 20 additions & 0 deletions doc/How to build - Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,28 @@ Debug->Start Debugging or press F5

PrusaSlicer should start. You're up and running!

### Running Unit Tests

For the most complete unit testing, use the Debug build option `-DCMAKE_BUILD_TYPE=Debug` when running cmake.
Without the Debug build, internal assert statements are not tested.

To run the unit tests:

cd build
make test


To run a specific unit test:

cd build\tests

The unit tests can be found by

`dir *\*_tests`

Any of these unit tests can be run directly e.g.

`.\fff_print\fff_print_tests`

## 2.B Run the automatic build script

Expand Down
Loading

0 comments on commit 7841aa5

Please sign in to comment.