Skip to content

Allow to build PrusaSlicer with EGL support #14214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ else()
endif()
endif()

option(SLIC3R_STATIC "Compile PrusaSlicer with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL})
option(SLIC3R_STATIC "Compile PrusaSlicer with static libraries (Boost, TBB)" ${SLIC3R_STATIC_INITIAL})
option(SLIC3R_GUI "Compile PrusaSlicer with GUI components (OpenGL, wxWidgets)" 1)
# A lot of Linux distribution don't build wxWidgets with EGL support yet. This
# is why by default this option is set to OFF. If a Linux distribution has
# built wxWidgets EGL support, you should turn that on!
option(SLIC3R_EGL "Compile PrusaSlicer with Wayland (EGL) support" OFF)
option(SLIC3R_FHS "Assume PrusaSlicer is to be installed in a FHS directory structure" 0)
option(SLIC3R_PCH "Use precompiled headers" 1)
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
Expand Down Expand Up @@ -474,14 +478,6 @@ find_package(PNG REQUIRED)
set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL REQUIRED)

# Find glew or use bundled version
if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_GLEW)
set(GLEW_USE_STATIC_LIBS ON)
set(GLEW_VERBOSE ON)
endif()

find_package(GLEW REQUIRED)

# Find the Cereal serialization library
find_package(cereal REQUIRED)
add_library(libcereal INTERFACE)
Expand Down
1 change: 1 addition & 0 deletions bundled_deps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
add_subdirectory(admesh)
add_subdirectory(avrdude)
add_subdirectory(miniz)
add_subdirectory(glad)
add_subdirectory(glu-libtess)
add_subdirectory(agg)
add_subdirectory(libigl)
Expand Down
17 changes: 17 additions & 0 deletions bundled_deps/glad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This has been created by the Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator
#
# See https://glad.sh/ for the webservice
#
# Permalink to code:
# https://gen.glad.sh/#generator=c&api=gl%3D4.6%2Cgles2%3D3.2&profile=gl%3Dcompatibility%2Cgles1%3Dcommon&extensions=GL_ARB_compatibility%2CGL_ARB_framebuffer_object%2CGL_EXT_framebuffer_blit%2CGL_EXT_framebuffer_multisample%2CGL_EXT_framebuffer_object%2CGL_EXT_texture_compression_s3tc%2CGL_EXT_texture_filter_anisotropic%2CGL_KHR_debug&options=LOADER
add_library(glad_gl STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/gl.c)
target_include_directories(
glad_gl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
)
add_library(GLAD::GL ALIAS glad_gl)

add_library(glad_gles STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/gl.c)
target_include_directories(
glad_gles PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
)
add_library(GLAD::GLES ALIAS glad_gles)
Loading