fix(stable): wx 3.3.2 nanosvg ODR via --allow-multiple-definition (Linux)

This commit is contained in:
thysson2701
2026-06-11 23:51:41 +02:00
parent 403fd750c3
commit 72bb69748b
2 changed files with 2 additions and 7 deletions

View File

@@ -121,6 +121,8 @@ endif (MINGW)
if (NOT WIN32 AND NOT APPLE)
# Binary name on unix like systems (Linux, Unix)
set_target_properties(OrcaSlicer PROPERTIES OUTPUT_NAME "orca-slicer")
# wx 3.3 bundles nanosvg internally causing duplicate symbols; allow them.
target_link_options(OrcaSlicer PRIVATE "-Wl,--allow-multiple-definition")
set(SLIC3R_APP_CMD "orca-slicer")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dev-utils/platform/unix/build_linux_image.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_linux_image.sh USE_SOURCE_PERMISSIONS @ONLY)
endif ()

View File

@@ -14,13 +14,6 @@
#include <wx/rawbmp.h>
#endif /* __WXGTK2__ */
#include <GL/glew.h>
// wx 3.3+ includes nanosvg internally; avoid ODR violations by making our copy static.
#define nsvgParse orca_nsvgParse
#define nsvgParseFromFile orca_nsvgParseFromFile
#define nsvgDelete orca_nsvgDelete
#define nsvgCreateRasterizer orca_nsvgCreateRasterizer
#define nsvgDeleteRasterizer orca_nsvgDeleteRasterizer
#define nsvgRasterize orca_nsvgRasterize
#define NANOSVG_IMPLEMENTATION
#include "nanosvg/nanosvg.h"
#define NANOSVGRAST_IMPLEMENTATION