mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-04-22 14:10:09 +08:00
Debug Improvments on Windows (#3275)
* fix assert statements * Add ORCA_INCLUDE_DEBUG_INFO to deps cmake adds option ORCA_INCLUDE_DEBUG_INFO to deps build script to allow an alternative for RelWithDebInfo that works on windows * add build type option to windows script * update .gitignore to include build*
This commit is contained in:
parent
73481da6da
commit
c4a66f36ae
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,7 +1,7 @@
|
|||||||
Build
|
Build
|
||||||
Build.bat
|
Build.bat
|
||||||
/build*/
|
/build*/
|
||||||
deps/build
|
deps/build*
|
||||||
MYMETA.json
|
MYMETA.json
|
||||||
MYMETA.yml
|
MYMETA.yml
|
||||||
_build
|
_build
|
||||||
|
@ -1,26 +1,50 @@
|
|||||||
set WP=%CD%
|
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
|
cd deps
|
||||||
mkdir build
|
mkdir %build_dir%
|
||||||
cd build
|
cd %build_dir%
|
||||||
set DEPS=%CD%/OrcaSlicer_dep
|
set DEPS=%CD%/OrcaSlicer_dep
|
||||||
if "%1"=="slicer" (
|
if "%1"=="slicer" (
|
||||||
GOTO :slicer
|
GOTO :slicer
|
||||||
)
|
)
|
||||||
echo "building deps.."
|
echo "building deps.."
|
||||||
cmake ../ -G "Visual Studio 16 2019" -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=Release
|
|
||||||
cmake --build . --config Release --target deps -- -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
|
if "%1"=="deps" exit /b 0
|
||||||
|
|
||||||
:slicer
|
:slicer
|
||||||
echo "building Orca Slicer..."
|
echo "building Orca Slicer..."
|
||||||
cd %WP%
|
cd %WP%
|
||||||
mkdir build
|
mkdir %build_dir%
|
||||||
cd build
|
cd %build_dir%
|
||||||
|
|
||||||
cmake .. -G "Visual Studio 16 2019" -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0"
|
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 --build . --config Release --target ALL_BUILD -- -m
|
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 ..
|
cd ..
|
||||||
call run_gettext.bat
|
call run_gettext.bat
|
||||||
cd build
|
cd %build_dir%
|
||||||
cmake --build . --target install --config Release
|
cmake --build . --target install --config %build_type%
|
||||||
|
@ -13,10 +13,30 @@ if "%1"=="pack" (
|
|||||||
exit /b 0
|
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
|
setlocal DISABLEDELAYEDEXPANSION
|
||||||
cd deps
|
cd deps
|
||||||
mkdir build
|
mkdir %build_dir%
|
||||||
cd build
|
cd %build_dir%
|
||||||
set DEPS=%CD%/OrcaSlicer_dep
|
set DEPS=%CD%/OrcaSlicer_dep
|
||||||
|
|
||||||
if "%1"=="slicer" (
|
if "%1"=="slicer" (
|
||||||
@ -24,22 +44,22 @@ if "%1"=="slicer" (
|
|||||||
)
|
)
|
||||||
echo "building deps.."
|
echo "building deps.."
|
||||||
|
|
||||||
|
echo cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo%
|
||||||
cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=Release
|
cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo%
|
||||||
cmake --build . --config Release --target deps -- -m
|
cmake --build . --config %build_type% --target deps -- -m
|
||||||
|
|
||||||
if "%1"=="deps" exit /b 0
|
if "%1"=="deps" exit /b 0
|
||||||
|
|
||||||
:slicer
|
:slicer
|
||||||
echo "building Orca Slicer..."
|
echo "building Orca Slicer..."
|
||||||
cd %WP%
|
cd %WP%
|
||||||
mkdir build
|
mkdir %build_dir%
|
||||||
cd build
|
cd %build_dir%
|
||||||
|
|
||||||
echo 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=Release
|
echo 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%
|
||||||
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=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0"
|
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="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0"
|
||||||
cmake --build . --config Release --target ALL_BUILD -- -m
|
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||||
cd ..
|
cd ..
|
||||||
call run_gettext.bat
|
call run_gettext.bat
|
||||||
cd build
|
cd %build_dir%
|
||||||
cmake --build . --target install --config Release
|
cmake --build . --target install --config %build_type%
|
||||||
|
15
deps/CMakeLists.txt
vendored
15
deps/CMakeLists.txt
vendored
@ -43,7 +43,12 @@ endif ()
|
|||||||
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
|
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(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/../DL_CACHE CACHE PATH "Path for downloaded source packages.")
|
||||||
|
|
||||||
option(DEP_DEBUG "Build debug variants (only applicable on Windows)" OFF)
|
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 ()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
|
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
|
||||||
@ -87,8 +92,6 @@ find_package(Git REQUIRED)
|
|||||||
# The default command line for patching. Only works for newer
|
# The default command line for patching. Only works for newer
|
||||||
set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix)
|
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)
|
if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Release)
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.")
|
message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.")
|
||||||
@ -99,7 +102,11 @@ function(orcaslicer_add_cmake_project projectname)
|
|||||||
|
|
||||||
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
||||||
if (_is_multi OR MSVC)
|
if (_is_multi OR MSVC)
|
||||||
set(_configs_line "")
|
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 ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set(_gen "")
|
set(_gen "")
|
||||||
|
@ -156,7 +156,7 @@ void PressureEqualizer::process_layer(const std::string &gcode)
|
|||||||
long PressureEqualizer::advance_segment_beyond_small_gap(const long idx_orig)
|
long PressureEqualizer::advance_segment_beyond_small_gap(const long idx_orig)
|
||||||
{
|
{
|
||||||
// this should only be run on the last extruding line before a gap
|
// this should only be run on the last extruding line before a gap
|
||||||
assert(m_gcode_lines[idx_cur_pos].extruding());
|
assert(m_gcode_lines[idx_orig].extruding());
|
||||||
double distance_traveled = 0.0;
|
double distance_traveled = 0.0;
|
||||||
// start at beginning of gap, advance till extrusion found or gap too big
|
// start at beginning of gap, advance till extrusion found or gap too big
|
||||||
for (auto idx_cur_pos = idx_orig + 1; idx_cur_pos < m_gcode_lines.size(); idx_cur_pos++) {
|
for (auto idx_cur_pos = idx_orig + 1; idx_cur_pos < m_gcode_lines.size(); idx_cur_pos++) {
|
||||||
|
@ -142,8 +142,8 @@ static std::vector<std::pair<TreeSupportSettings, std::vector<size_t>>> group_me
|
|||||||
const PrintObjectConfig &object_config = print_object.config();
|
const PrintObjectConfig &object_config = print_object.config();
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
// Support must be enabled and set to Tree style.
|
// Support must be enabled and set to Tree style.
|
||||||
assert(object_config.support_material || object_config.support_material_enforce_layers > 0);
|
assert(object_config.enable_support || object_config.enforce_support_layers > 0);
|
||||||
assert(object_config.support_material_style == smsTree || object_config.support_material_style == smsOrganic);
|
assert(object_config.support_type == stTree || object_config.support_style == smsOrganic);
|
||||||
|
|
||||||
bool found_existing_group = false;
|
bool found_existing_group = false;
|
||||||
TreeSupportSettings next_settings{ TreeSupportMeshGroupSettings{ print_object }, print_object.slicing_parameters() };
|
TreeSupportSettings next_settings{ TreeSupportMeshGroupSettings{ print_object }, print_object.slicing_parameters() };
|
||||||
@ -3541,7 +3541,7 @@ static void generate_support_areas(Print &print, const BuildVolume &build_volume
|
|||||||
draw_areas(*print.get_object(processing.second.front()), volumes, config, overhangs, move_bounds,
|
draw_areas(*print.get_object(processing.second.front()), volumes, config, overhangs, move_bounds,
|
||||||
bottom_contacts, top_contacts, intermediate_layers, layer_storage, throw_on_cancel);
|
bottom_contacts, top_contacts, intermediate_layers, layer_storage, throw_on_cancel);
|
||||||
else {
|
else {
|
||||||
assert(print_object.config().support_material_style == smsOrganic);
|
assert(print_object.config().support_style == smsOrganic);
|
||||||
organic_draw_branches(
|
organic_draw_branches(
|
||||||
*print.get_object(processing.second.front()), volumes, config, move_bounds,
|
*print.get_object(processing.second.front()), volumes, config, move_bounds,
|
||||||
bottom_contacts, top_contacts, interface_placer, intermediate_layers, layer_storage,
|
bottom_contacts, top_contacts, interface_placer, intermediate_layers, layer_storage,
|
||||||
|
@ -22,8 +22,8 @@ TreeSupportMeshGroupSettings::TreeSupportMeshGroupSettings(const PrintObject &pr
|
|||||||
// const std::vector<unsigned int> printing_extruders = print_object.object_extruders();
|
// const std::vector<unsigned int> printing_extruders = print_object.object_extruders();
|
||||||
|
|
||||||
// Support must be enabled and set to Tree style.
|
// Support must be enabled and set to Tree style.
|
||||||
assert(config.support_material || config.support_material_enforce_layers > 0);
|
assert(config.enable_support || config.enforce_support_layers > 0);
|
||||||
assert(config.support_material_style == smsTree || config.support_material_style == smsOrganic);
|
assert(config.support_type == stTree || config.support_style == smsOrganic);
|
||||||
|
|
||||||
// Calculate maximum external perimeter width over all printing regions, taking into account the default layer height.
|
// Calculate maximum external perimeter width over all printing regions, taking into account the default layer height.
|
||||||
coordf_t external_perimeter_width = 0.;
|
coordf_t external_perimeter_width = 0.;
|
||||||
|
@ -922,7 +922,6 @@ void GLMmSegmentationGizmo3DScene::render(size_t triangle_indices_idx) const
|
|||||||
{
|
{
|
||||||
assert(triangle_indices_idx < this->triangle_indices_VBO_ids.size());
|
assert(triangle_indices_idx < this->triangle_indices_VBO_ids.size());
|
||||||
assert(this->triangle_patches.size() == this->triangle_indices_VBO_ids.size());
|
assert(this->triangle_patches.size() == this->triangle_indices_VBO_ids.size());
|
||||||
assert(this->vertices_VAO_id != 0);
|
|
||||||
assert(this->vertices_VBO_id != 0);
|
assert(this->vertices_VBO_id != 0);
|
||||||
assert(this->triangle_indices_VBO_ids[triangle_indices_idx] != 0);
|
assert(this->triangle_indices_VBO_ids[triangle_indices_idx] != 0);
|
||||||
|
|
||||||
@ -954,7 +953,6 @@ void GLMmSegmentationGizmo3DScene::render(size_t triangle_indices_idx) const
|
|||||||
|
|
||||||
void GLMmSegmentationGizmo3DScene::finalize_vertices()
|
void GLMmSegmentationGizmo3DScene::finalize_vertices()
|
||||||
{
|
{
|
||||||
assert(this->vertices_VAO_id == 0);
|
|
||||||
assert(this->vertices_VBO_id == 0);
|
assert(this->vertices_VBO_id == 0);
|
||||||
if (!this->vertices.empty()) {
|
if (!this->vertices.empty()) {
|
||||||
glsafe(::glGenBuffers(1, &this->vertices_VBO_id));
|
glsafe(::glGenBuffers(1, &this->vertices_VBO_id));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user