depot/third_party/nixpkgs/pkgs/by-name/as/aseprite/shared-fmt.patch
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

71 lines
2.2 KiB
Diff

--- a/CMakeLists.txt 2022-01-08 00:37:08.165330523 +0100
+++ b/CMakeLists.txt 2022-01-08 00:52:41.163585173 +0100
@@ -54,6 +54,7 @@
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)
@@ -165,6 +165,7 @@
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)
@@ -204,6 +205,15 @@
set(CURL_STATICLIB ON BOOL)
endif()
+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)
--- a/src/app/CMakeLists.txt 2022-01-08 00:37:07.378671200 +0100
+++ b/src/app/CMakeLists.txt 2022-01-08 00:53:13.669969512 +0100
@@ -741,7 +741,7 @@ target_link_libraries(app-lib
${HARFBUZZ_LIBRARIES}
json11
archive_static
- fmt
+ ${FMT_LIBRARIES}
tinyexpr
qoi)
if(ENABLE_PSD)
--- a/src/dio/CMakeLists.txt 2022-01-08 00:41:50.712726972 +0100
+++ b/src/dio/CMakeLists.txt 2022-01-08 00:53:39.936408022 +0100
@@ -10,7 +10,7 @@
target_link_libraries(dio-lib
${ZLIB_LIBRARIES}
- fmt
+ ${FMT_LIBRARIES}
flic-lib
laf-base
fixmath-lib
--- a/third_party/CMakeLists.txt 2022-01-08 00:37:08.165330523 +0100
+++ b/third_party/CMakeLists.txt 2022-01-08 00:54:30.455969136 +0100
@@ -106,7 +106,10 @@
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)