From https://github.com/winterheart/aseprite/tree/v1.3.16.1-unbundle From: "Azamat H. Hackimov" Date: Fri, 9 Oct 2020 02:18:36 +0300 Subject: [PATCH 1/7] Make LibArchive as shared library dependency --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,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_GIFLIB "Use your installed copy of giflib" off) option(USE_SHARED_ZLIB "Use your installed copy of zlib" off) +option(USE_SHARED_LIBARCHIVE "Use your installed copy of libarchive" off) option(USE_SHARED_LIBPNG "Use your installed copy of libpng" off) option(USE_SHARED_TINYEXIF "Use your installed copy of TinyEXIF" off) option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off) @@ -237,6 +238,16 @@ else() endif() include_directories(${ZLIB_INCLUDE_DIRS}) +# libarchive +if(USE_SHARED_LIBARCHIVE) + find_package(LibArchive REQUIRED) +else() + set(LibArchive_FOUND) + set(LibArchive_LIBRARIES archive_static) + set(LibArchive_INCLUDE_DIRS $) +endif() +include_directories(${LibArchive_INCLUDE_DIRS}) + # libpng if(USE_SHARED_LIBPNG) find_package(PNG REQUIRED) --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -787,8 +787,8 @@ target_link_libraries(app-lib ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} libjpeg-turbo + ${LibArchive_LIBRARIES} json11 - archive_static fmt tinyexpr qoi) --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -128,6 +128,7 @@ endif() add_subdirectory(json11) # libarchive +if(NOT USE_SHARED_LIBARCHIVE) set(HAVE_WCSCPY 1) set(HAVE_WCSLEN 1) @@ -151,6 +152,7 @@ set(WINDOWS_VERSION "WS08" CACHE STRING "Set Windows Vista as the target version add_subdirectory(libarchive) target_include_directories(archive_static INTERFACE $) +endif() # benchmark if(ENABLE_BENCHMARKS) -- 2.51.2