Skip to content

Commit

Permalink
Merge branch 'prusa3d:master' into feature-configurable-solid-infill
Browse files Browse the repository at this point in the history
  • Loading branch information
mjonuschat authored Feb 19, 2024
2 parents cec4c0b + e09f6e5 commit c026baf
Show file tree
Hide file tree
Showing 1,265 changed files with 420,763 additions and 270,846 deletions.
12 changes: 6 additions & 6 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignOperands: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
Expand All @@ -25,7 +25,7 @@ BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
Expand All @@ -46,7 +46,7 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 140
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ xs/MANIFEST.bak
xs/assertlib*
.init_bundle.ini
.vs/*
local-lib
/src/TAGS
/.vscode/
build-linux/*
deps/build*
deps/build-linux/*
**/.DS_Store
**/.idea/
.pkg_cache
CMakeUserPresets.json
132 changes: 0 additions & 132 deletions Build.PL

This file was deleted.

48 changes: 26 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#/|/ Copyright (c) Prusa Research 2017 - 2023 Tomáš Mészáros @tamasmeszaros, Vojtěch Bubník @bubnikv, Lukáš Matěna @lukasmatena, Filip Sykala @Jony01, Oleksandra Iushchenko @YuSanka, Lukáš Hejl @hejllukas, David Kocík @kocikdav, Enrico Turri @enricoturri1966, Vojtěch Král @vojtechkral
#/|/ Copyright (c) 2023 Ben Greiner
#/|/ Copyright (c) 2021 D-mo @dimitry-ishenko
#/|/ Copyright (c) 2020 Pascal de Bruijn @pmjdebruijn
#/|/ Copyright (c) 2019 Sam Segers
#/|/ Copyright (c) 2019 Colin Gilgenbach @hexane360
#/|/ Copyright (c) 2018 Dan Kortschak
#/|/
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
#/|/
cmake_minimum_required(VERSION 3.13)
project(PrusaSlicer)

Expand Down Expand Up @@ -26,14 +36,12 @@ endif()
option(SLIC3R_STATIC "Compile PrusaSlicer with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL})
option(SLIC3R_GUI "Compile PrusaSlicer with GUI components (OpenGL, wxWidgets)" 1)
option(SLIC3R_FHS "Assume PrusaSlicer 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_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)
option(SLIC3R_PERL_XS "Compile XS Perl module and enable Perl unit and integration tests" 0)
option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0)
option(SLIC3R_UBSAN "Enable UBSan on Clang and GCC" 0)
option(SLIC3R_ENABLE_FORMAT_STEP "Enable compilation of STEP file support" 1)
option(SLIC3R_ENABLE_FORMAT_STEP "Enable compilation of STEP file support" ON)
# If SLIC3R_FHS is 1 -> SLIC3R_DESKTOP_INTEGRATION is always 0, othrewise variable.
CMAKE_DEPENDENT_OPTION(SLIC3R_DESKTOP_INTEGRATION "Allow perfoming desktop integration during runtime" 1 "NOT SLIC3R_FHS" 0)

Expand All @@ -51,6 +59,15 @@ if (SLIC3R_STATIC)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
endif ()

# Dependency build management
option(${PROJECT_NAME}_BUILD_DEPS "Build dependencies before the project" OFF)
option(${PROJECT_NAME}_DEPS_OUTPUT_QUIET "Don't print build output for dependencies" OFF)
set(${PROJECT_NAME}_DEPS_PRESET "default" CACHE STRING "Preset of the dependencies when ${PROJECT_NAME}_BUILD_DEPS is ON")
set(${PROJECT_NAME}_DEPS_BUILD_DIR "" CACHE PATH "Binary dir of the dependencies build when ${PROJECT_NAME}_BUILD_DEPS is ON")
if (${PROJECT_NAME}_BUILD_DEPS)
include(deps/autobuild.cmake)
endif ()

if (APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FIND_APPBUNDLE LAST)
Expand All @@ -60,13 +77,11 @@ if (APPLE)
endif ()
endif ()

# Proposal for C++ unit tests and sandboxes
option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF)
option(SLIC3R_BUILD_TESTS "Build unit tests" ON)

if (IS_CROSS_COMPILE)
message("Detected cross compilation setup. Tests and encoding checks will be forcedly disabled!")
set(SLIC3R_PERL_XS OFF CACHE BOOL "" FORCE)
set(SLIC3R_BUILD_TESTS OFF CACHE BOOL "" FORCE)
endif ()

Expand Down Expand Up @@ -159,10 +174,6 @@ if(NOT WIN32)
add_compile_options("$<$<CONFIG:DEBUG>:-DDEBUG>")
endif()

# To be able to link libslic3r with the Perl XS module.
# Once we get rid of Perl and libslic3r is linked statically, we can get rid of -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# WIN10SDK_PATH is used to point CMake to the WIN10 SDK installation directory.
# We pick it from environment if it is not defined in another way
if(WIN32)
Expand All @@ -177,24 +188,24 @@ if(WIN32)
else()
message("WIN10SDK_PATH is invalid: ${WIN10SDK_PATH}")
message("${WIN10SDK_PATH}/include/winrt/windows.graphics.printing3d.h was not found")
message("STL fixing by the Netfabb service will not be compiled")
message("STL fixing by WinSDK will not be compiled")
unset(WIN10SDK_PATH)
endif()
else()
# Try to use the default Windows 10 SDK path.
set(WIN10SDK_INCLUDE_PATH "$ENV{WindowsSdkDir}/Include/$ENV{WindowsSDKVersion}")
if (NOT EXISTS "${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h")
message("${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h was not found")
message("STL fixing by the Netfabb service will not be compiled")
message("STL fixing by WinSDK will not be compiled")
unset(WIN10SDK_INCLUDE_PATH)
endif()
endif()
if(WIN10SDK_INCLUDE_PATH)
message("Building with Win10 Netfabb STL fixing service support")
message("Building with Win10 STL fixing service support")
add_definitions(-DHAS_WIN10SDK)
include_directories("${WIN10SDK_INCLUDE_PATH}")
else()
message("Building without Win10 Netfabb STL fixing service support")
message("Building without Win10 STL fixing service support")
endif()
endif()

Expand Down Expand Up @@ -584,12 +595,12 @@ function(prusaslicer_copy_dlls target)

# This has to be a separate target due to the windows command line lenght limits
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir}
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/+GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir}
COMMENT "Copy gmp runtime to build tree"
VERBATIM)

add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir}
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/+MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir}
COMMENT "Copy mpfr runtime to build tree"
VERBATIM)

Expand All @@ -602,13 +613,6 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT P

add_dependencies(gettext_make_pot hintsToPot)

# Perl bindings, currently only used for the unit / integration tests of libslic3r.
# Also runs the unit / integration tests.
#FIXME Port the tests into C++ to finally get rid of the Perl!
if (SLIC3R_PERL_XS)
add_subdirectory(xs)
endif ()

if(SLIC3R_BUILD_SANDBOXES)
add_subdirectory(sandboxes)
endif()
Expand Down
46 changes: 46 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"version": 3,
"configurePresets": [
{
"name": "default",
"displayName": "Default Config",
"description": "Building with statically linked dependencies",
"binaryDir": "${sourceDir}/build-default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"SLIC3R_STATIC": true,
"SLIC3R_GTK": "3",
"SLIC3R_ENC_CHECK": false,
"SLIC3R_PCH": true,
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build-default/dist",
"PrusaSlicer_DEPS_PRESET": "default",
"PrusaSlicer_DEPS_OUTPUT_QUIET": false
}
},
{
"name": "no-occt",
"displayName": "Without STEP",
"description": "Building with statically linked dependencies without STEP file support",
"inherits": "default",
"binaryDir": "${sourceDir}/build-no-occt",
"cacheVariables": {
"SLIC3R_ENABLE_FORMAT_STEP": false,
"PrusaSlicer_DEPS_PRESET": "no-occt"
}
},
{
"name": "shareddeps",
"displayName": "Shared dependencies",
"description": "Building with dynamically linked dependencies from the system",
"binaryDir": "${sourceDir}/shareddeps",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"SLIC3R_STATIC": false,
"SLIC3R_GTK": "3",
"SLIC3R_ENC_CHECK": false,
"SLIC3R_PCH": true,
"PrusaSlicer_BUILD_DEPS": false
}
}
]
}
Binary file removed PrusaSlicer.mo
Binary file not shown.
Loading

0 comments on commit c026baf

Please sign in to comment.