Skip to content

Commit

Permalink
Linux: support EGL
Browse files Browse the repository at this point in the history
- skia library is now shared (CI/scripts needs fixes)
- skia can now be built against EGL (USE_EGL=ON)

Last changes for initial wayland support.

Ref: #396
  • Loading branch information
rodlie committed Dec 26, 2024
1 parent 5ffb5ca commit b8cfe8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
23 changes: 2 additions & 21 deletions src/cmake/friction-common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,6 @@ if(MSVC)
add_definitions("/MP")
endif()

if(UNIX AND NOT APPLE)
option(STATIC_FFMPEG "Link against static ffmpeg" OFF)
if(${STATIC_FFMPEG})
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic")
endif()
endif()

if(NOT WIN32)
if ((NOT ${CMAKE_VERSION} VERSION_LESS 3.11) AND (NOT OpenGL_GL_PREFERENCE))
set(OpenGL_GL_PREFERENCE "GLVND")
endif()
find_package(OpenGL REQUIRED)
endif()

find_package(PkgConfig QUIET)
find_package(QT NAMES Qt5 COMPONENTS Core REQUIRED)
find_package(
Expand Down Expand Up @@ -117,13 +103,8 @@ if(WIN32)
add_definitions(-DSKIA_DLL)
set(SKIA_LIBRARIES_DIRS ${CMAKE_SOURCE_DIR}/sdk/bin)
else()
if(APPLE)
set(SKIA_LIBRARIES skia)
else()
set(SKIA_LIBRARIES
skia
fontconfig
${OPENGL_LIBRARY})
set(SKIA_LIBRARIES skia)
if(UNIX AND NOT APPLE)
pkg_check_modules(UNWIND REQUIRED libunwind)
set(GPERF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/../gperftools ${UNWIND_INCLUDE_DIRS})
set(GPERF_LIBRARIES tcmalloc_static ${UNWIND_LIBRARIES})
Expand Down
3 changes: 2 additions & 1 deletion src/core/appsupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,9 @@ void AppSupport::initEnv(const bool &isRenderer)
if (isRenderer) { // Force Mesa if Renderer
qputenv("LIBGL_ALWAYS_SOFTWARE", "1");
}
// Force XCB on Linux until we support Wayland
#ifdef PROJECT_OFFICIAL
qputenv("QT_QPA_PLATFORM", isRenderer ? "offscreen" : "xcb");
#endif
#else
Q_UNUSED(isRenderer)
#endif
Expand Down
8 changes: 8 additions & 0 deletions src/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ option(LINUX_DEPLOY "Linux Deploy" OFF)
option(MAC_DEPLOY "Mac Deploy" OFF)
option(SYNC_SKIA_DEPS "Sync third-party depends" ON)

if(UNIX AND NOT APPLE)
option(USE_EGL "Use EGL in skia" OFF)
endif()

set(SKIA_SRC "${CMAKE_CURRENT_SOURCE_DIR}/skia")
set(SKIA_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/skia")

Expand Down Expand Up @@ -72,6 +76,10 @@ else()
endif()
set(SKIA_ARGS "ar=\"${CMAKE_AR}\" cc=\"${CMAKE_C_COMPILER}\" cxx=\"${CMAKE_CXX_COMPILER}\"")
if(UNIX AND NOT APPLE)
if(${USE_EGL})
set(SKIA_ARGS "${SKIA_ARGS} skia_use_egl=true")
endif()
set(SKIA_ARGS "${SKIA_ARGS} is_component_build=true")
if (${LINUX_DEPLOY})
set(SKIA_ARGS "${SKIA_ARGS} extra_cflags=[\"-Wno-error\"]")
else()
Expand Down

0 comments on commit b8cfe8c

Please sign in to comment.