From 69ec239a1f63ed89b37f103e41d77adbf9fc97e6 Mon Sep 17 00:00:00 2001 From: sowens99 Date: Mon, 2 Oct 2023 00:52:48 -0400 Subject: [PATCH] Add lz4 submodule --- .gitmodules | 3 +++ CMakeLists.txt | 2 ++ Externals/lz4/CMakeLists.txt | 13 +++++++++++++ Externals/lz4/LZ4.vcxproj | 34 +++++++++++++++++++++++++++++++++ Externals/lz4/exports.props | 13 +++++++++++++ Externals/lz4/lz4 | 1 + Source/Core/Core/CMakeLists.txt | 1 + Source/Core/DolphinLib.vcxproj | 1 + Source/dolphin-emu.sln | 11 +++++++++++ 9 files changed, 79 insertions(+) create mode 100644 Externals/lz4/CMakeLists.txt create mode 100644 Externals/lz4/LZ4.vcxproj create mode 100644 Externals/lz4/exports.props create mode 160000 Externals/lz4/lz4 diff --git a/.gitmodules b/.gitmodules index bac18a1143..8e701abf03 100644 --- a/.gitmodules +++ b/.gitmodules @@ -63,3 +63,6 @@ [submodule "Externals/fmt/fmt"] path = Externals/fmt/fmt url = https://github.com/fmtlib/fmt.git +[submodule "Externals/lz4/lz4"] + path = Externals/lz4/lz4 + url = https://github.com/lz4/lz4 diff --git a/CMakeLists.txt b/CMakeLists.txt index b6e3601ce2..b1eede22aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -682,6 +682,8 @@ dolphin_find_optional_system_library_pkgconfig(MINIZIP minizip>=3.0.0 minizip::m dolphin_find_optional_system_library(LZO Externals/LZO) +dolphin_find_optional_system_library_pkgconfig(lz4 liblz4>=1.8 LZ4::LZ4 Externals/lz4) + dolphin_find_optional_system_library_pkgconfig(SPNG spng spng::spng Externals/libspng) # Using static FreeSurround from Externals diff --git a/Externals/lz4/CMakeLists.txt b/Externals/lz4/CMakeLists.txt new file mode 100644 index 0000000000..065e52593a --- /dev/null +++ b/Externals/lz4/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.13) + +# We only want the static library, nothing else. +set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) +set(LZ4_BUILD_CLI OFF) +set(LZ4_BUILD_LEGACY_LZ4C OFF) +set(LZ4_BUNDLED_MODE ON) + +add_subdirectory(lz4/build/cmake) + +dolphin_disable_warnings_msvc(lz4_static) +add_library(LZ4::LZ4 ALIAS lz4_static) + diff --git a/Externals/lz4/LZ4.vcxproj b/Externals/lz4/LZ4.vcxproj new file mode 100644 index 0000000000..4bb1b83268 --- /dev/null +++ b/Externals/lz4/LZ4.vcxproj @@ -0,0 +1,34 @@ + + + + + + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476} + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/lz4/exports.props b/Externals/lz4/exports.props new file mode 100644 index 0000000000..58d3c4d3ec --- /dev/null +++ b/Externals/lz4/exports.props @@ -0,0 +1,13 @@ + + + + + $(ExternalsDir)lz4\lz4\lib;%(AdditionalIncludeDirectories) + + + + + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476} + + + diff --git a/Externals/lz4/lz4 b/Externals/lz4/lz4 new file mode 160000 index 0000000000..5fc0630a0e --- /dev/null +++ b/Externals/lz4/lz4 @@ -0,0 +1 @@ +Subproject commit 5fc0630a0ed55e9755b0fe3990cd021ae1c3edc1 diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 60f3c54a84..4a40eb7ec8 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -627,6 +627,7 @@ PRIVATE FatFs fmt::fmt LZO::LZO + LZ4::LZ4 ZLIB::ZLIB ) diff --git a/Source/Core/DolphinLib.vcxproj b/Source/Core/DolphinLib.vcxproj index 827652cae7..d2071d6618 100644 --- a/Source/Core/DolphinLib.vcxproj +++ b/Source/Core/DolphinLib.vcxproj @@ -46,6 +46,7 @@ + diff --git a/Source/dolphin-emu.sln b/Source/dolphin-emu.sln index 916bc2ec73..ebb269de71 100644 --- a/Source/dolphin-emu.sln +++ b/Source/dolphin-emu.sln @@ -25,6 +25,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Languages", "..\Languages\L EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LZO", "..\Externals\LZO\LZO.vcxproj", "{AB993F38-C31D-4897-B139-A620C42BC565}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lz4", "..\Externals\LZ4\LZ4.vcxproj", "{9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniupnpc", "..\Externals\miniupnpc\miniupnpc.vcxproj", "{31643FDB-1BB8-4965-9DE7-000FC88D35AE}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xxhash", "..\Externals\xxhash\xxhash.vcxproj", "{677EA016-1182-440C-9345-DC88D1E98C0C}" @@ -173,6 +175,14 @@ Global {AB993F38-C31D-4897-B139-A620C42BC565}.Release|ARM64.Build.0 = Release|ARM64 {AB993F38-C31D-4897-B139-A620C42BC565}.Release|x64.ActiveCfg = Release|x64 {AB993F38-C31D-4897-B139-A620C42BC565}.Release|x64.Build.0 = Release|x64 + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}.Debug|ARM64.ActiveCfg = Debug|x64 + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}.Debug|ARM64.Build.0 = Debug|x64 + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}.Debug|x64.ActiveCfg = Debug|x64 + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}.Debug|x64.Build.0 = Debug|x64 + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}.Release|ARM64.ActiveCfg = Release|ARM64 + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}.Release|ARM64.Build.0 = Release|ARM64 + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}.Release|x64.ActiveCfg = Release|x64 + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}.Release|x64.Build.0 = Release|x64 {31643FDB-1BB8-4965-9DE7-000FC88D35AE}.Debug|ARM64.ActiveCfg = Debug|ARM64 {31643FDB-1BB8-4965-9DE7-000FC88D35AE}.Debug|ARM64.Build.0 = Debug|ARM64 {31643FDB-1BB8-4965-9DE7-000FC88D35AE}.Debug|x64.ActiveCfg = Debug|x64 @@ -436,6 +446,7 @@ Global GlobalSection(NestedProjects) = preSolution {8ADA04D7-6DB1-4DA4-AB55-64FB12A0997B} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} {AB993F38-C31D-4897-B139-A620C42BC565} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} + {9092C5CC-3E71-41B3-BF68-4A7BDD8A5476} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} {31643FDB-1BB8-4965-9DE7-000FC88D35AE} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} {677EA016-1182-440C-9345-DC88D1E98C0C} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} {F6EA7144-8D64-4EBB-A13E-76DFBD911EAE} = {87ADDFF9-5768-4DA2-A33B-2477593D6677}