From a680ffe985b00a05fe5d0a87d50b7a37e0cb9ff0 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 12 Nov 2021 04:24:43 +0000 Subject: [PATCH] Link LZIP directly instead of as a static library. --- 3rdparty/CMakeLists.txt | 2 -- 3rdparty/lzip.cmake | 8 ++------ CMakeLists.txt | 3 ++- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 196f20f..70e4ba1 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -1,5 +1,3 @@ -include(lzip.cmake) - include(lzfse.cmake) include(lzma.cmake) diff --git a/3rdparty/lzip.cmake b/3rdparty/lzip.cmake index a1b4267..05c1705 100644 --- a/3rdparty/lzip.cmake +++ b/3rdparty/lzip.cmake @@ -1,9 +1,5 @@ -project(lzlib C) - -set("LZIP_DIRECTORY" "lzlib-1.12") +set("LZIP_DIRECTORY" "3rdparty/lzlib-1.12") message(STATUS "LZIP VERSION: 1.12") -add_library(lzlib STATIC ${LZIP_DIRECTORY}/lzlib.c) - -set_property(TARGET lzlib PROPERTY C_VISIBILITY_PRESET hidden) \ No newline at end of file +target_sources("Aaru.Compression.Native" PRIVATE ${LZIP_DIRECTORY}/lzlib.c) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 5aed220..6198486 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,7 @@ add_library("Aaru.Compression.Native" SHARED library.c apple_rle.c apple_rle.h a include(3rdparty/bzip2.cmake) include(3rdparty/flac.cmake) +include(3rdparty/lzip.cmake) MACRO(TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE target) if("${CMAKE_C_COMPILER_ID}" MATCHES "MSVC") @@ -117,7 +118,7 @@ MACRO(TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE target) ENDIF() ENDMACRO() -TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE("Aaru.Compression.Native" lzlib lzfse libzstd_static lzma m) +TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE("Aaru.Compression.Native" lzfse libzstd_static lzma m) if(NOT "${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW" OR (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")) set_property(TARGET "Aaru.Compression.Native" PROPERTY POSITION_INDEPENDENT_CODE TRUE)