[DO-971] ffmpeg recipe with requirements (!9)
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/9
This commit is contained in:
27
recipes/libsvtav1/all/conandata.yml
Normal file
27
recipes/libsvtav1/all/conandata.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
sources:
|
||||
"2.2.1":
|
||||
url: "https://nexus.avroid.tech/repository/all-raw-proxy-gitlab_com/AOMediaCodec/SVT-AV1/-/archive/v2.2.1/SVT-AV1-v2.2.1.tar.gz"
|
||||
sha256: "d02b54685542de0236bce4be1b50912aba68aff997c43b350d84a518df0cf4e5"
|
||||
"2.1.2":
|
||||
url: "https://nexus.avroid.tech/repository/all-raw-proxy-gitlab_com/AOMediaCodec/SVT-AV1/-/archive/v2.1.2/SVT-AV1-v2.1.2.tar.gz"
|
||||
sha256: "65e90af18f31f8c8d2e9febf909a7d61f36172536abb25a7089f152210847cd9"
|
||||
"2.1.0":
|
||||
url: "https://nexus.avroid.tech/repository/all-raw-proxy-gitlab_com/AOMediaCodec/SVT-AV1/-/archive/v2.1.0/SVT-AV1-v2.1.0.tar.gz"
|
||||
sha256: "72a076807544f3b269518ab11656f77358284da7782cece497781ab64ed4cb8a"
|
||||
"1.7.0":
|
||||
url: "https://nexus.avroid.tech/repository/all-raw-proxy-gitlab_com/AOMediaCodec/SVT-AV1/-/archive/v1.7.0/SVT-AV1-v1.7.0.tar.gz"
|
||||
sha256: "ce0973584f1a187aa4abf63f509ff8464397120878e322a3153f87e9c161fc4f"
|
||||
"1.6.0":
|
||||
url: "https://nexus.avroid.tech/repository/all-raw-proxy-gitlab_com/AOMediaCodec/SVT-AV1/-/archive/v1.6.0/SVT-AV1-v1.6.0.tar.bz2"
|
||||
sha256: "c6b49111a2d4c5113f1ada0c2f716d94bd4a8db704623d453066826401ecdab5"
|
||||
patches:
|
||||
"1.7.0":
|
||||
- patch_file: "patches/external-cpuinfo-1.7.0.patch"
|
||||
patch_type: "portability"
|
||||
patch_source: https://nexus.avroid.tech/repository/all-raw-proxy-gitlab_com/AOMediaCodec/SVT-AV1/-/merge_requests/2178
|
||||
patch_description: "Allow compiling with external cpuinfo"
|
||||
"1.6.0":
|
||||
- patch_file: "patches/external-cpuinfo-1.6.0.patch"
|
||||
patch_type: "portability"
|
||||
patch_source: https://nexus.avroid.tech/repository/all-raw-proxy-gitlab_com/AOMediaCodec/SVT-AV1/-/merge_requests/2178
|
||||
patch_description: "Allow compiling with external cpuinfo"
|
||||
146
recipes/libsvtav1/all/conanfile.py
Normal file
146
recipes/libsvtav1/all/conanfile.py
Normal file
@@ -0,0 +1,146 @@
|
||||
import os
|
||||
from conan import ConanFile
|
||||
from conan.tools.cmake import cmake_layout, CMakeToolchain, CMakeDeps, CMake
|
||||
from conan.tools.files import copy, get, rmdir, apply_conandata_patches, export_conandata_patches
|
||||
from conan.tools.scm import Version
|
||||
from conan.errors import ConanInvalidConfiguration
|
||||
|
||||
required_conan_version = ">=1.54.0"
|
||||
|
||||
|
||||
class SVTAV1Conan(ConanFile):
|
||||
name = "libsvtav1"
|
||||
description = "An AV1-compliant software encoder/decoder library"
|
||||
license = "BSD-3-Clause"
|
||||
url = "https://github.com/conan-io/conan-center-index"
|
||||
homepage = "https://gitlab.com/AOMediaCodec/SVT-AV1"
|
||||
topics = ("av1", "codec", "encoder", "decoder", "video")
|
||||
package_type = "library"
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
options = {
|
||||
"shared": [True, False],
|
||||
"fPIC": [True, False],
|
||||
"build_encoder": [True, False],
|
||||
"build_decoder": [True, False],
|
||||
"minimal_build": [True, False],
|
||||
"with_neon": [True, False],
|
||||
"with_arm_crc32": [True, False],
|
||||
"with_neon_dotprod": [True, False],
|
||||
"with_neon_i8mm": [True, False],
|
||||
"with_neon_sve": [True, False],
|
||||
"with_neon_sve2": [True, False],
|
||||
}
|
||||
default_options = {
|
||||
"shared": False,
|
||||
"fPIC": True,
|
||||
"build_encoder": True,
|
||||
"build_decoder": True,
|
||||
"minimal_build": False,
|
||||
"with_neon": True,
|
||||
"with_arm_crc32": True,
|
||||
"with_neon_dotprod": True,
|
||||
"with_neon_i8mm": True,
|
||||
"with_neon_sve": True,
|
||||
"with_neon_sve2": True,
|
||||
}
|
||||
|
||||
def export_sources(self):
|
||||
export_conandata_patches(self)
|
||||
|
||||
def config_options(self):
|
||||
if self.settings.os == "Windows":
|
||||
self.options.rm_safe("fPIC")
|
||||
if Version(self.version) < "2.0.0":
|
||||
del self.options.minimal_build
|
||||
if Version(self.version) >= "2.1.1":
|
||||
# https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/c949fe4f14fe288a9b2b47aa3e61335422a83645/CHANGELOG.md#211---2024-06-25
|
||||
del self.options.build_decoder
|
||||
if Version(self.version) < "2.2.1" or self.settings.arch not in ("armv8", "armv8.3"):
|
||||
del self.options.with_neon
|
||||
del self.options.with_arm_crc32
|
||||
del self.options.with_neon_dotprod
|
||||
del self.options.with_neon_i8mm
|
||||
del self.options.with_neon_sve
|
||||
del self.options.with_neon_sve2
|
||||
|
||||
def configure(self):
|
||||
if self.options.shared:
|
||||
self.options.rm_safe("fPIC")
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self, src_folder="src")
|
||||
|
||||
def requirements(self):
|
||||
self.requires("cpuinfo/cci.20231129")
|
||||
|
||||
def validate(self):
|
||||
# https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2081
|
||||
# https://gitlab.com/AOMediaCodec/SVT-AV1/-/commit/800a81b09db1cf8c9c289ecf6f70381d7888b98c
|
||||
if Version(self.version) < "1.9.0" and self.settings.os == "Android":
|
||||
raise ConanInvalidConfiguration(f"{self.ref} does not support Android before version 1.9.0.")
|
||||
|
||||
def build_requirements(self):
|
||||
# if Version(self.version) >= "1.3.0":
|
||||
# self.tool_requires("cmake/[>=3.16 <4]")
|
||||
if self.settings.arch in ("x86", "x86_64"):
|
||||
self.tool_requires("nasm/2.16.01")
|
||||
|
||||
def source(self):
|
||||
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||
|
||||
def generate(self):
|
||||
tc = CMakeToolchain(self)
|
||||
tc.variables["BUILD_APPS"] = False
|
||||
if Version(self.version) < "2.1.1":
|
||||
tc.variables["BUILD_DEC"] = self.options.build_decoder
|
||||
tc.variables["BUILD_ENC"] = self.options.build_encoder
|
||||
tc.variables["USE_EXTERNAL_CPUINFO"] = True
|
||||
if self.settings.arch in ("x86", "x86_64"):
|
||||
tc.variables["ENABLE_NASM"] = True
|
||||
tc.variables["MINIMAL_BUILD"] = self.options.get_safe("minimal_build", False)
|
||||
if "with_neon" in self.options:
|
||||
tc.variables["ENABLE_NEON"] = self.options.with_neon
|
||||
if "with_arm_crc32" in self.options:
|
||||
tc.variables["ENABLE_ARM_CRC32"] = self.options.with_arm_crc32
|
||||
if "with_neon_dotprod" in self.options:
|
||||
tc.variables["ENABLE_NEON_DOTPROD"] = self.options.with_neon_dotprod
|
||||
if "with_neon_i8mm" in self.options:
|
||||
tc.variables["ENABLE_NEON_i8MM"] = self.options.with_neon_i8mm
|
||||
if "with_sve" in self.options:
|
||||
tc.variables["ENABLE_SVE"] = self.options.with_sve
|
||||
if "with_sve2" in self.options:
|
||||
tc.variables["ENABLE_SVE2"] = self.options.with_sve2
|
||||
|
||||
tc.generate()
|
||||
deps = CMakeDeps(self)
|
||||
deps.generate()
|
||||
|
||||
def build(self):
|
||||
apply_conandata_patches(self)
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def package(self):
|
||||
for license_file in ("LICENSE.md", "PATENTS.md"):
|
||||
copy(self, license_file, self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.install()
|
||||
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
|
||||
|
||||
def package_info(self):
|
||||
if self.options.build_encoder:
|
||||
self.cpp_info.components["encoder"].libs = ["SvtAv1Enc"]
|
||||
self.cpp_info.components["encoder"].includedirs = ["include/svt-av1"]
|
||||
self.cpp_info.components["encoder"].set_property("pkg_config_name", "SvtAv1Enc")
|
||||
self.cpp_info.components["encoder"].requires = ["cpuinfo::cpuinfo"]
|
||||
if self.settings.os in ("FreeBSD", "Linux"):
|
||||
self.cpp_info.components["encoder"].system_libs = ["pthread", "dl", "m"]
|
||||
if self.options.get_safe("build_decoder"):
|
||||
self.cpp_info.components["decoder"].libs = ["SvtAv1Dec"]
|
||||
self.cpp_info.components["decoder"].includedirs = ["include/svt-av1"]
|
||||
self.cpp_info.components["decoder"].set_property("pkg_config_name", "SvtAv1Dec")
|
||||
self.cpp_info.components["decoder"].requires = ["cpuinfo::cpuinfo"]
|
||||
if self.settings.os in ("FreeBSD", "Linux"):
|
||||
self.cpp_info.components["encoder"].system_libs = ["pthread", "dl", "m"]
|
||||
68
recipes/libsvtav1/all/patches/external-cpuinfo-1.6.0.patch
Normal file
68
recipes/libsvtav1/all/patches/external-cpuinfo-1.6.0.patch
Normal file
@@ -0,0 +1,68 @@
|
||||
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||
index f98c8675acc06b3c998f29fcc712ac8befcda129..f464ead3ea55bacd71451a24252cbaf33194292c 100644
|
||||
--- a/test/CMakeLists.txt
|
||||
+++ b/test/CMakeLists.txt
|
||||
@@ -151,7 +151,7 @@ set(lib_list
|
||||
$<TARGET_OBJECTS:ENCODER_ASM_AVX512>
|
||||
$<TARGET_OBJECTS:ENCODER_GLOBALS>
|
||||
$<TARGET_OBJECTS:ENCODER_CODEC>
|
||||
- cpuinfo_public
|
||||
+ $<IF:$<BOOL:${USE_EXTERNAL_CPUINFO}>,cpuinfo::cpuinfo,cpuinfo_public>
|
||||
gtest_all)
|
||||
if(UNIX)
|
||||
# App Source Files
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b651306f208f2ff0e577e89ce37fed3e80eea0ce..25df70551b8db09becab23cfa5000f03b90a9c77 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -41,6 +41,11 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
endif()
|
||||
|
||||
option(COMPILE_C_ONLY "Compile only C code with no simds (autodetect, default off for x86)" OFF)
|
||||
+option(USE_EXTERNAL_CPUINFO "Consume system cpuinfo library only" OFF)
|
||||
+
|
||||
+if(USE_EXTERNAL_CPUINFO)
|
||||
+ find_package(cpuinfo CONFIG REQUIRED)
|
||||
+endif()
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
@@ -590,7 +595,7 @@ endif()
|
||||
|
||||
add_subdirectory(third_party/fastfeat)
|
||||
|
||||
-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
+if(NOT USE_EXTERNAL_CPUINFO AND NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
add_subdirectory(third_party/cpuinfo)
|
||||
endif()
|
||||
|
||||
diff --git a/Source/Lib/Encoder/CMakeLists.txt b/Source/Lib/Encoder/CMakeLists.txt
|
||||
index 88553bfc4511ffcd5571300d1d45c9302d9316a6..a587e7c6ba15f7528482f476b46506b09c12cf2e 100644
|
||||
--- a/Source/Lib/Encoder/CMakeLists.txt
|
||||
+++ b/Source/Lib/Encoder/CMakeLists.txt
|
||||
@@ -129,7 +129,9 @@ set_target_properties(SvtAv1Enc PROPERTIES VERSION ${ENC_VERSION})
|
||||
set_target_properties(SvtAv1Enc PROPERTIES SOVERSION ${ENC_VERSION_MAJOR})
|
||||
set_target_properties(SvtAv1Enc PROPERTIES C_VISIBILITY_PRESET hidden)
|
||||
target_link_libraries(SvtAv1Enc PUBLIC ${PLATFORM_LIBS})
|
||||
-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
+if(USE_EXTERNAL_CPUINFO)
|
||||
+ target_link_libraries(SvtAv1Enc PRIVATE cpuinfo::cpuinfo)
|
||||
+elseif(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
target_link_libraries(SvtAv1Enc PRIVATE cpuinfo_public)
|
||||
endif()
|
||||
|
||||
diff --git a/Source/Lib/Decoder/CMakeLists.txt b/Source/Lib/Decoder/CMakeLists.txt
|
||||
index 0f220a78a6db783ef2b5d6dd6cc182766c4362a3..8fb88f1c958fa965bc8f9ed9c1d563ee3858baee 100644
|
||||
--- a/Source/Lib/Decoder/CMakeLists.txt
|
||||
+++ b/Source/Lib/Decoder/CMakeLists.txt
|
||||
@@ -147,7 +147,9 @@ set_target_properties(SvtAv1Dec PROPERTIES SOVERSION ${DEC_VERSION_MAJOR})
|
||||
set_target_properties(SvtAv1Dec PROPERTIES C_VISIBILITY_PRESET hidden)
|
||||
add_dependencies(SvtAv1Dec EbVersionHeaderGen)
|
||||
target_link_libraries(SvtAv1Dec PUBLIC ${PLATFORM_LIBS})
|
||||
-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
+if(USE_EXTERNAL_CPUINFO)
|
||||
+ target_link_libraries(SvtAv1Dec PRIVATE cpuinfo::cpuinfo)
|
||||
+elseif(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
target_link_libraries(SvtAv1Dec PRIVATE cpuinfo_public)
|
||||
endif()
|
||||
|
||||
68
recipes/libsvtav1/all/patches/external-cpuinfo-1.7.0.patch
Normal file
68
recipes/libsvtav1/all/patches/external-cpuinfo-1.7.0.patch
Normal file
@@ -0,0 +1,68 @@
|
||||
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||
index 3ed7c05a28ad1b46f2a79e23630d6ad17e6c6741..251a592a46046ae1878e2913683f3417db0260ad 100644
|
||||
--- a/test/CMakeLists.txt
|
||||
+++ b/test/CMakeLists.txt
|
||||
@@ -152,7 +152,7 @@ set(lib_list
|
||||
$<TARGET_OBJECTS:ENCODER_ASM_AVX512>
|
||||
$<TARGET_OBJECTS:ENCODER_GLOBALS>
|
||||
$<TARGET_OBJECTS:ENCODER_CODEC>
|
||||
- cpuinfo_public
|
||||
+ $<IF:$<BOOL:${USE_EXTERNAL_CPUINFO}>,cpuinfo::cpuinfo,cpuinfo_public>
|
||||
gtest_all)
|
||||
if(UNIX)
|
||||
# App Source Files
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 58642d108e2a4b042e2f7a66180e1ba2d06f043e..5b7d001473af01305d396b3d2f312adc0b3f5b81 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -41,6 +41,11 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
endif()
|
||||
|
||||
option(COMPILE_C_ONLY "Compile only C code with no simds (autodetect, default off for x86)" OFF)
|
||||
+option(USE_EXTERNAL_CPUINFO "Consume system cpuinfo library only" OFF)
|
||||
+
|
||||
+if(USE_EXTERNAL_CPUINFO)
|
||||
+ find_package(cpuinfo CONFIG REQUIRED)
|
||||
+endif()
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
@@ -590,7 +595,7 @@ endif()
|
||||
|
||||
add_subdirectory(third_party/fastfeat)
|
||||
|
||||
-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
+if(NOT USE_EXTERNAL_CPUINFO AND NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
add_subdirectory(third_party/cpuinfo)
|
||||
endif()
|
||||
|
||||
diff --git a/Source/Lib/Decoder/CMakeLists.txt b/Source/Lib/Decoder/CMakeLists.txt
|
||||
index 0f220a78a6db783ef2b5d6dd6cc182766c4362a3..8fb88f1c958fa965bc8f9ed9c1d563ee3858baee 100644
|
||||
--- a/Source/Lib/Decoder/CMakeLists.txt
|
||||
+++ b/Source/Lib/Decoder/CMakeLists.txt
|
||||
@@ -147,7 +147,9 @@ set_target_properties(SvtAv1Dec PROPERTIES SOVERSION ${DEC_VERSION_MAJOR})
|
||||
set_target_properties(SvtAv1Dec PROPERTIES C_VISIBILITY_PRESET hidden)
|
||||
add_dependencies(SvtAv1Dec EbVersionHeaderGen)
|
||||
target_link_libraries(SvtAv1Dec PUBLIC ${PLATFORM_LIBS})
|
||||
-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
+if(USE_EXTERNAL_CPUINFO)
|
||||
+ target_link_libraries(SvtAv1Dec PRIVATE cpuinfo::cpuinfo)
|
||||
+elseif(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
target_link_libraries(SvtAv1Dec PRIVATE cpuinfo_public)
|
||||
endif()
|
||||
|
||||
diff --git a/Source/Lib/Encoder/CMakeLists.txt b/Source/Lib/Encoder/CMakeLists.txt
|
||||
index e2a1348aa2c07a7283266323bcf58d15dc278555..13be1227444afa74055cd5172ded084de4474b91 100644
|
||||
--- a/Source/Lib/Encoder/CMakeLists.txt
|
||||
+++ b/Source/Lib/Encoder/CMakeLists.txt
|
||||
@@ -129,7 +129,9 @@ set_target_properties(SvtAv1Enc PROPERTIES VERSION ${ENC_VERSION})
|
||||
set_target_properties(SvtAv1Enc PROPERTIES SOVERSION ${ENC_VERSION_MAJOR})
|
||||
set_target_properties(SvtAv1Enc PROPERTIES C_VISIBILITY_PRESET hidden)
|
||||
target_link_libraries(SvtAv1Enc PUBLIC ${PLATFORM_LIBS})
|
||||
-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
+if(USE_EXTERNAL_CPUINFO)
|
||||
+ target_link_libraries(SvtAv1Enc PRIVATE cpuinfo::cpuinfo)
|
||||
+elseif(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
target_link_libraries(SvtAv1Enc PRIVATE cpuinfo_public)
|
||||
endif()
|
||||
|
||||
21
recipes/libsvtav1/all/patches/llvm-clang-macos.patch
Normal file
21
recipes/libsvtav1/all/patches/llvm-clang-macos.patch
Normal file
@@ -0,0 +1,21 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 25a40f09..9c861554 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -203,10 +203,12 @@ endif()
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
set(CMAKE_MACOSX_RPATH 1)
|
||||
- set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
- set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
- set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
- set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
+ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang")
|
||||
+ set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
+ set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
+ set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
+ set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
+ endif()
|
||||
else()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack -z relro -z now")
|
||||
endif()
|
||||
11
recipes/libsvtav1/all/test_package/CMakeLists.txt
Normal file
11
recipes/libsvtav1/all/test_package/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(test_package LANGUAGES CXX)
|
||||
|
||||
find_package(libsvtav1 REQUIRED CONFIG)
|
||||
|
||||
add_executable(${PROJECT_NAME} test_package.cpp)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE libsvtav1::encoder)
|
||||
if (TARGET libsvtav1::decoder)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE libsvtav1::decoder)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_DECODER)
|
||||
endif()
|
||||
26
recipes/libsvtav1/all/test_package/conanfile.py
Normal file
26
recipes/libsvtav1/all/test_package/conanfile.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.cmake import CMake, cmake_layout
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def test(self):
|
||||
if can_run(self):
|
||||
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
|
||||
self.run(bin_path, env="conanrun")
|
||||
8
recipes/libsvtav1/all/test_package/test_package.cpp
Normal file
8
recipes/libsvtav1/all/test_package/test_package.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "EbSvtAv1Enc.h"
|
||||
#ifdef HAVE_DECODER
|
||||
# include "EbSvtAv1Dec.h"
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main() { std::cout << svt_av1_get_version() << "\n"; }
|
||||
11
recipes/libsvtav1/config.yml
Normal file
11
recipes/libsvtav1/config.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
versions:
|
||||
"2.2.1":
|
||||
folder: all
|
||||
"2.1.2":
|
||||
folder: all
|
||||
"2.1.0":
|
||||
folder: all
|
||||
"1.7.0":
|
||||
folder: all
|
||||
"1.6.0":
|
||||
folder: all
|
||||
Reference in New Issue
Block a user