initial commit
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b1bd0189b..3fb7abffb 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -66,6 +66,7 @@ enable_testing()
|
||||
|
||||
option(USE_SHARED_CMARK "Use your installed copy of cmark" off)
|
||||
option(USE_SHARED_CURL "Use your installed copy of curl" off)
|
||||
+option(USE_SHARED_FMT "Use your installed copy of fmt" off)
|
||||
option(USE_SHARED_GIFLIB "Use your installed copy of giflib" off)
|
||||
option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off)
|
||||
option(USE_SHARED_ZLIB "Use your installed copy of zlib" off)
|
||||
@@ -185,6 +186,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_PROFILE "${CMAKE_BINARY_DIR}/bin")
|
||||
set(SOURCE_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
|
||||
set(CMARK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/cmark)
|
||||
set(CURL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/curl)
|
||||
+set(FMT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt)
|
||||
set(GIFLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/giflib)
|
||||
set(LIBJPEG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/jpeg)
|
||||
set(LIBPNG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libpng)
|
||||
@@ -225,6 +227,16 @@ if(NOT USE_SHARED_CURL)
|
||||
set(CURL_STATICLIB ON BOOL)
|
||||
endif()
|
||||
|
||||
+# fmt
|
||||
+if(USE_SHARED_FMT)
|
||||
+ find_package(FMT REQUIRED)
|
||||
+ set(FMT_LIBRARIES fmt::fmt)
|
||||
+else()
|
||||
+ set(FMT_FOUND)
|
||||
+ set(FMT_LIBRARIES fmt)
|
||||
+ # No need to include extra directories, actually
|
||||
+endif()
|
||||
+
|
||||
# zlib
|
||||
if(USE_SHARED_ZLIB)
|
||||
find_package(ZLIB REQUIRED)
|
||||
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
|
||||
index 9c67c0268..b19a3e412 100644
|
||||
--- a/src/app/CMakeLists.txt
|
||||
+++ b/src/app/CMakeLists.txt
|
||||
@@ -754,7 +754,7 @@ target_link_libraries(app-lib
|
||||
${ZLIB_LIBRARIES}
|
||||
json11
|
||||
archive_static
|
||||
- fmt
|
||||
+ ${FMT_LIBRARIES}
|
||||
tinyexpr
|
||||
qoi)
|
||||
|
||||
diff --git a/src/dio/CMakeLists.txt b/src/dio/CMakeLists.txt
|
||||
index 55cb24de5..b253dca0b 100644
|
||||
--- a/src/dio/CMakeLists.txt
|
||||
+++ b/src/dio/CMakeLists.txt
|
||||
@@ -16,7 +16,7 @@ endif()
|
||||
|
||||
target_link_libraries(dio-lib
|
||||
${ZLIB_LIBRARIES}
|
||||
- fmt
|
||||
+ ${FMT_LIBRARIES}
|
||||
flic-lib
|
||||
laf-base
|
||||
fixmath-lib
|
||||
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
|
||||
index 9d09a98c8..1973b134b 100644
|
||||
--- a/third_party/CMakeLists.txt
|
||||
+++ b/third_party/CMakeLists.txt
|
||||
@@ -117,7 +117,10 @@ if(NOT USE_SHARED_HARFBUZZ AND NOT LAF_BACKEND STREQUAL "skia")
|
||||
endif()
|
||||
|
||||
add_subdirectory(simpleini)
|
||||
-add_subdirectory(fmt)
|
||||
+
|
||||
+if(NOT USE_SHARED_FMT)
|
||||
+ add_subdirectory(fmt)
|
||||
+endif()
|
||||
|
||||
# Add cmark without tests
|
||||
if(NOT USE_SHARED_CMARK)
|
||||
@@ -0,0 +1,21 @@
|
||||
diff --git a/cmake/FindJpegTurbo.cmake b/cmake/FindJpegTurbo.cmake
|
||||
index 33b5204..0407a6a 100644
|
||||
--- a/cmake/FindJpegTurbo.cmake
|
||||
+++ b/cmake/FindJpegTurbo.cmake
|
||||
@@ -9,14 +9,11 @@
|
||||
|
||||
if(LAF_BACKEND STREQUAL "skia")
|
||||
|
||||
- find_library(LIBJPEG_TURBO_LIBRARY NAMES libjpeg jpeg
|
||||
- HINTS "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH)
|
||||
- set(LIBJPEG_TURBO_INCLUDE_DIRS "${SKIA_DIR}/third_party/externals/libjpeg-turbo")
|
||||
+ find_library(LIBJPEG_TURBO_LIBRARY NAMES libjpeg jpeg)
|
||||
|
||||
add_library(libjpeg-turbo STATIC IMPORTED)
|
||||
set_target_properties(libjpeg-turbo PROPERTIES
|
||||
- IMPORTED_LOCATION "${LIBJPEG_TURBO_LIBRARY}"
|
||||
- INTERFACE_INCLUDE_DIRECTORIES ${LIBJPEG_TURBO_INCLUDE_DIRS})
|
||||
+ IMPORTED_LOCATION "${LIBJPEG_TURBO_LIBRARY}")
|
||||
|
||||
else()
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 87aed2f28f9c..498472ec2a60 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -76,6 +76,7 @@ option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off)
|
||||
option(USE_SHARED_PIXMAN "Use your installed copy of pixman" off)
|
||||
option(USE_SHARED_FREETYPE "Use shared FreeType library" off)
|
||||
option(USE_SHARED_HARFBUZZ "Use shared HarfBuzz library" off)
|
||||
+option(USE_SHARED_WEBP "Use your installed copy of webp" off)
|
||||
option(ENABLE_ASEPRITE_EXE "Compile main Aseprite executable" on)
|
||||
option(ENABLE_MEMLEAK "Enable memory-leaks detector (only for developers)" off)
|
||||
option(ENABLE_NEWS "Enable the news in Home tab" on)
|
||||
@@ -380,7 +381,20 @@ add_subdirectory(laf)
|
||||
# libwebp
|
||||
if(ENABLE_WEBP)
|
||||
# Use libwebp from Skia
|
||||
- if(LAF_BACKEND STREQUAL "skia")
|
||||
+ if(USE_SHARED_WEBP)
|
||||
+ find_library(WEBP_LIBRARY NAMES webp)
|
||||
+ find_library(WEBPDEMUX_LIBRARY NAMES webpdemux)
|
||||
+ find_library(WEBPMUX_LIBRARY NAMES webpmux)
|
||||
+ set(WEBP_LIBRARIES ${WEBP_LIBRARY} ${WEBPDEMUX_LIBRARY} ${WEBPMUX_LIBRARY})
|
||||
+ find_path(WEBP_INCLUDE_DIRS NAMES decode.h PATH_SUFFIXES webp)
|
||||
+ find_path(WEBP_INCLUDE_DIRS NAMES decode.h PATH_SUFFIXES webp)
|
||||
+ find_path(WEBP_INCLUDE_DIRS NAMES decode.h PATH_SUFFIXES webp)
|
||||
+ if(WEBP_LIBRARIES)
|
||||
+ set(WEBP_FOUND ON)
|
||||
+ else()
|
||||
+ set(WEBP_FOUND OFF)
|
||||
+ endif()
|
||||
+ elseif(LAF_BACKEND STREQUAL "skia")
|
||||
find_library(WEBP_LIBRARIES webp
|
||||
NAMES libwebp # required for Windows
|
||||
PATHS "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH)
|
||||
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
|
||||
index 1973b134b9f8..f15dba5a7968 100644
|
||||
--- a/third_party/CMakeLists.txt
|
||||
+++ b/third_party/CMakeLists.txt
|
||||
@@ -33,7 +33,7 @@ if(NOT USE_SHARED_GIFLIB)
|
||||
add_subdirectory(giflib)
|
||||
endif()
|
||||
|
||||
-if(ENABLE_WEBP AND NOT LAF_BACKEND STREQUAL "skia")
|
||||
+if(ENABLE_WEBP AND NOT LAF_BACKEND STREQUAL "skia" AND NOT USE_SHARED_WEBP)
|
||||
set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.")
|
||||
set(WEBP_BUILD_ANIM_UTILS OFF CACHE BOOL "Build animation utilities.")
|
||||
set(WEBP_BUILD_CWEBP OFF CACHE BOOL "Build the cwebp command line tool.")
|
||||
@@ -0,0 +1,21 @@
|
||||
--- src/laf/cmake/FindSkia.cmake.orig 2022-01-08 02:15:13.417619266 +0100
|
||||
+++ src/laf/cmake/FindSkia.cmake 2022-01-08 02:15:43.603960491 +0100
|
||||
@@ -32,14 +32,18 @@
|
||||
# SkShaper module + freetype + harfbuzz
|
||||
find_library(SKSHAPER_LIBRARY skshaper PATH "${SKIA_LIBRARY_DIR}")
|
||||
|
||||
+if(NOT USE_SHARED_FREETYPE)
|
||||
set(FREETYPE_FOUND ON)
|
||||
find_library(FREETYPE_LIBRARY freetype2 PATH "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH)
|
||||
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
|
||||
set(FREETYPE_INCLUDE_DIRS "${SKIA_DIR}/third_party/externals/freetype/include")
|
||||
+endif()
|
||||
|
||||
+if(NOT USE_SHARED_HARFBUZZ)
|
||||
find_library(HARFBUZZ_LIBRARY harfbuzz PATH "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH)
|
||||
set(HARFBUZZ_LIBRARIES ${HARFBUZZ_LIBRARY})
|
||||
set(HARFBUZZ_INCLUDE_DIRS "${SKIA_DIR}/third_party/externals/harfbuzz/src")
|
||||
+endif()
|
||||
|
||||
set(SKIA_LIBRARIES
|
||||
${SKIA_LIBRARY}
|
||||
Reference in New Issue
Block a user