mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-19 09:08:57 +08:00
Using system libpng where present.
This avoids the crash caused on Linux where it should be present.
This commit is contained in:
parent
3bdb12ada1
commit
a52807df72
@ -344,20 +344,22 @@ add_library(semver STATIC
|
|||||||
# Configure rasterizer target
|
# Configure rasterizer target
|
||||||
# ##############################################################################
|
# ##############################################################################
|
||||||
|
|
||||||
option(RASTERIZER_USE_SYSTEM_LIBPNG "Use the libpng present in system instead of
|
find_package(PNG)
|
||||||
the provided copy." OFF)
|
|
||||||
|
option(RASTERIZER_FORCE_BUILTIN_LIBPNG "Force the usage of builting libpng instead of the system version." OFF)
|
||||||
|
|
||||||
add_library(rasterizer STATIC
|
add_library(rasterizer STATIC
|
||||||
${LIBDIR}/libslic3r/Rasterizer/Rasterizer.hpp
|
${LIBDIR}/libslic3r/Rasterizer/Rasterizer.hpp
|
||||||
${LIBDIR}/libslic3r/Rasterizer/Rasterizer.cpp
|
${LIBDIR}/libslic3r/Rasterizer/Rasterizer.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(RASTERIZER_USE_SYSTEM_LIBPNG)
|
if(PNG_FOUND AND NOT RASTERIZER_FORCE_BUILTIN_LIBPNG)
|
||||||
find_package(PNG REQUIRED)
|
message(STATUS "Using system libpng.")
|
||||||
target_link_libraries(rasterizer PRIVATE ${PNG_LIBRARIES})
|
target_link_libraries(rasterizer PRIVATE ${PNG_LIBRARIES})
|
||||||
target_include_directories(rasterizer PRIVATE ${PNG_INCLUDE_DIRS})
|
target_include_directories(rasterizer PRIVATE ${PNG_INCLUDE_DIRS})
|
||||||
target_compile_definitions(rasterizer PRIVATE ${PNG_DEFINITIONS})
|
target_compile_definitions(rasterizer PRIVATE ${PNG_DEFINITIONS})
|
||||||
else()
|
else()
|
||||||
|
message(WARNING "Using builtin libpng. This can cause crashes on some platforms.")
|
||||||
add_subdirectory( ${LIBDIR}/png/zlib)
|
add_subdirectory( ${LIBDIR}/png/zlib)
|
||||||
|
|
||||||
set(ZLIB_INCLUDE_DIR
|
set(ZLIB_INCLUDE_DIR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user