Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-10-16 19:48:02 +03:00
parent a67b787386
commit d368760f78
20 changed files with 9358 additions and 108 deletions

View File

@@ -1,10 +1,25 @@
cmake_minimum_required(VERSION 3.16)
project(waylight LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_program(cppcheck_exe NAMES cppcheck)
if (cppcheck_exe)
set(cppcheck_opts --enable=all --inline-suppr --quiet --suppressions-list=${PROJECT_SOURCE_DIR}/cppcheck.supp)
add_custom_target(run_cppcheck
COMMAND ${cppcheck_exe}
--std=c++20 --enable=all --inline-suppr --quiet
--suppressions-list=${PROJECT_SOURCE_DIR}/cppcheck.supp
--project=${CMAKE_BINARY_DIR}/compile_commands.json
--check-level=exhaustive
-i ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(WAYLAND_CLIENT REQUIRED IMPORTED_TARGET wayland-client)
pkg_check_modules(WAYLAND_EGL REQUIRED IMPORTED_TARGET wayland-egl)
@@ -60,6 +75,24 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(lunasvg)
FetchContent_Declare(
SQLiteCpp
GIT_REPOSITORY https://github.com/SRombauts/SQLiteCpp.git
GIT_TAG "3.3.3"
GIT_SHALLOW 1
)
FetchContent_MakeAvailable(SQLiteCpp)
FetchContent_Declare(
cpptrace
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
GIT_TAG "v1.0.1"
GIT_SHALLOW 1
)
FetchContent_MakeAvailable(cpptrace)
add_subdirectory(vendor)
find_program(WAYLAND_SCANNER wayland-scanner REQUIRED)
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
@@ -157,6 +190,7 @@ add_executable(waylight
${GEN_C_PRIVATES}
${CMAKE_CURRENT_SOURCE_DIR}/src/IconRegistry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Cache.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/TextRenderer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ImGui.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/App.cpp
@@ -180,11 +214,14 @@ target_link_libraries(waylight PRIVATE
PkgConfig::FONTCONFIG
PkgConfig::HARFBUZZ
cpptrace::cpptrace
tinyfiledialogs
mINI
raylib
msdfgen::msdfgen-core
msdfgen::msdfgen-ext
lunasvg::lunasvg
SQLiteCpp
m
dl
@@ -196,3 +233,4 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
endif()
install(TARGETS waylight RUNTIME DESTINATION bin)