Skip to content

Commit

Permalink
Migrate clip module from aseprite to laf
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Mar 26, 2024
1 parent c0c88e3 commit 7397d46
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "clip"]
path = clip
url = https://github.com/aseprite/clip.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/aseprite/googletest.git
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ endif()

option(LAF_WITH_EXAMPLES "Enable LAF examples" ON)
option(LAF_WITH_TESTS "Enable LAF tests" ON)
option(LAF_WITH_CLIP "Enable clip module (required for future drag-and-drop feature)" ON)
set(LAF_BACKEND ${LAF_DEFAULT_BACKEND} CACHE STRING "Select laf backend")
set_property(CACHE LAF_BACKEND PROPERTY STRINGS "none" "skia")

Expand All @@ -51,6 +52,16 @@ else()
endif()
endif()

if(LAF_WITH_CLIP)
# Disable clip examples and tests
set(CLIP_EXAMPLES OFF CACHE BOOL "Compile clip examples")
set(CLIP_TESTS OFF CACHE BOOL "Compile clip tests")
if(PNG_LIBRARY)
set(CLIP_X11_PNG_LIBRARY "${PNG_LIBRARY}")
endif()
add_subdirectory(clip)
endif()

add_subdirectory(third_party)
add_subdirectory(base)
add_subdirectory(gfx)
Expand Down
1 change: 1 addition & 0 deletions clip
Submodule clip added at 835cd0
5 changes: 5 additions & 0 deletions os/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ endif()

add_library(laf-os ${LAF_OS_SOURCES})
target_link_libraries(laf-os laf-gfx laf-base)
if(LAF_WITH_CLIP)
target_link_libraries(laf-os clip)
target_compile_definitions(laf-os PUBLIC
LAF_WITH_CLIP)
endif()
if(FREETYPE_LIBRARIES AND HARFBUZZ_LIBRARIES)
target_link_libraries(laf-os laf-ft)
target_compile_definitions(laf-os PRIVATE
Expand Down

0 comments on commit 7397d46

Please sign in to comment.