This commit is contained in:
2026-03-05 23:46:48 +01:00
commit 64ee43df24
8 changed files with 578 additions and 0 deletions

55
CMakeLists.txt Normal file
View File

@@ -0,0 +1,55 @@
cmake_minimum_required(VERSION 3.23)
project(editor)
include(FetchContent)
include(FindPkgConfig)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
FetchContent_Declare(
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
GIT_TAG 5.5
)
FetchContent_Declare(
sds
GIT_REPOSITORY https://github.com/antirez/sds.git
GIT_TAG 2.0.0
)
FetchContent_MakeAvailable(raylib)
FetchContent_MakeAvailable(sds)
if(NOT TARGET sds)
add_library(sds STATIC "${sds_SOURCE_DIR}/sds.c")
target_include_directories(sds PUBLIC "${sds_SOURCE_DIR}")
endif()
find_package(Freetype REQUIRED)
pkg_check_modules(HARFBUZZ REQUIRED harfbuzz)
add_executable(editor)
target_compile_features(editor PRIVATE c_std_11)
set_property(TARGET editor PROPERTY C_EXTENSIONS OFF)
target_sources(editor
PRIVATE
main.c
editor.c
)
target_compile_options(editor PRIVATE -Wall -Werror)
target_compile_options(editor PRIVATE ${HARFBUZZ_CFLAGS_OTHER})
target_include_directories(editor PRIVATE ${HARFBUZZ_INCLUDE_DIRS})
target_link_libraries(editor
PRIVATE
raylib
sds
Freetype::Freetype
${HARFBUZZ_LIBRARIES}
)