mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-20 15:13:45 +00:00
usse vcpkg just for the libsndfile build chain
This commit is contained in:
parent
a577d36679
commit
873fbbf1fe
1856 changed files with 1019 additions and 466624 deletions
|
|
@ -1,5 +1,49 @@
|
|||
################# Initialize Common Variables ###################
|
||||
set(VCPKG_ROOT "${CMAKE_BINARY_DIR}/vcpkg" CACHE PATH "VCPKG Root")
|
||||
if(NOT EXISTS "${VCPKG_ROOT}")
|
||||
message(STATUS "Bootstrapping vcpkg...")
|
||||
execute_process(
|
||||
COMMAND git clone https://github.com/microsoft/vcpkg.git "${VCPKG_ROOT}"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
)
|
||||
if(WIN32)
|
||||
execute_process(COMMAND "${VCPKG_ROOT}/bootstrap-vcpkg.bat")
|
||||
else()
|
||||
execute_process(COMMAND "${VCPKG_ROOT}/bootstrap-vcpkg.sh")
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
|
||||
if(WIN32)
|
||||
if(GIT_CI_BUILD)
|
||||
set(VCPKG_TARGET_TRIPLET "x64-windows-mixed-release" CACHE STRING "")
|
||||
else()
|
||||
set(VCPKG_TARGET_TRIPLET "x64-windows-mixed" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
else()
|
||||
if(APPLE)
|
||||
if(GIT_CI_BUILD)
|
||||
set(VCPKG_TARGET_TRIPLET "universal-osx-11-release" CACHE STRING "")
|
||||
else()
|
||||
set(VCPKG_TARGET_TRIPLET "universal-osx-11" CACHE STRING "")
|
||||
endif()
|
||||
endif(APPLE)
|
||||
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(GIT_CI_BUILD)
|
||||
set(VCPKG_TARGET_TRIPLET "x64-linux-mixed-release" CACHE STRING "")
|
||||
else()
|
||||
set(VCPKG_TARGET_TRIPLET "x64-linux-mixed" CACHE STRING "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
set(VCPKG_OVERLAY_TRIPLETS "${CMAKE_SOURCE_DIR}/Tools/CMake/vcpkg/triplets" CACHE STRING "")
|
||||
set(VCPKG_OVERLAY_PORTS "${CMAKE_SOURCE_DIR}/Tools/CMake/vcpkg/ports" CACHE STRING "")
|
||||
set(ENV{VCPKG_LIB_SOURCE_ROOT} "${CMAKE_SOURCE_DIR}/Engine/lib")
|
||||
set(ENV{VCPKG_KEEP_ENV_VARS} "VCPKG_LIB_SOURCE_ROOT")
|
||||
# All include directories to search. Modules should append to this when they want includes to point
|
||||
# into themselves.
|
||||
set(TORQUE_INCLUDE_DIRECTORIES "")
|
||||
|
|
|
|||
13
Tools/CMake/vcpkg/ports/libflac/android-cmake.diff
Normal file
13
Tools/CMake/vcpkg/ports/libflac/android-cmake.diff
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 9396130..11ef59d 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -122,7 +122,7 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
-if(ANDROID AND CMAKE_SYSTEM_VERSION VERSION_LESS 24 AND (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" OR CMAKE_SYSTEM_PROCESSOR MATCHES "armv7-a"))
|
||||
+if(ANDROID AND ANDROID_NATIVE_API_LEVEL VERSION_LESS "24" AND (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" OR CMAKE_SYSTEM_PROCESSOR MATCHES "armv7-a"))
|
||||
# fseeko/ftello may link, but it's not usable before Android API 24 on 32-bit Android
|
||||
# https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md
|
||||
message(STATUS "Disabling fseeko/ftello for 32-bit Android before API 24")
|
||||
18
Tools/CMake/vcpkg/ports/libflac/fix-compile-options.patch
Normal file
18
Tools/CMake/vcpkg/ports/libflac/fix-compile-options.patch
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c83dd83..2d1a7e6 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -82,9 +82,11 @@ if(HAVE_WERROR_FLAG)
|
||||
option(ENABLE_WERROR "Enable -Werror in all Makefiles" OFF)
|
||||
endif()
|
||||
|
||||
+if(MSVC AND NOT WITH_ASM)
|
||||
+ add_compile_options(/wd4267 /wd4996)
|
||||
+endif()
|
||||
+
|
||||
add_compile_options(
|
||||
- $<$<BOOL:${MSVC}>:/wd4267>
|
||||
- $<$<BOOL:${MSVC}>:/wd4996>
|
||||
$<$<BOOL:${ENABLE_WERROR}>:-Werror>
|
||||
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:${HAVE_WEFFCXX_FLAG}>>:-Weffc++>
|
||||
$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_DECL_AFTER_STMT_FLAG}>>:-Wdeclaration-after-statement>)
|
||||
15
Tools/CMake/vcpkg/ports/libflac/fix-find-threads.patch
Normal file
15
Tools/CMake/vcpkg/ports/libflac/fix-find-threads.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/flac-config.cmake.in b/flac-config.cmake.in
|
||||
index bcafc4c8..dcf299dd 100644
|
||||
--- a/flac-config.cmake.in
|
||||
+++ b/flac-config.cmake.in
|
||||
@@ -5,6 +5,10 @@ if(NOT TARGET Ogg::ogg)
|
||||
find_dependency(Ogg)
|
||||
endif()
|
||||
|
||||
+if (@ENABLE_MULTITHREADING@)
|
||||
+ find_dependency(Threads)
|
||||
+endif()
|
||||
+
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/targets.cmake")
|
||||
|
||||
if(TARGET FLAC::FLAC)
|
||||
80
Tools/CMake/vcpkg/ports/libflac/portfile.cmake
Normal file
80
Tools/CMake/vcpkg/ports/libflac/portfile.cmake
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
set(LOCAL_ARCHIVE "$ENV{VCPKG_LIB_SOURCE_ROOT}/xiph-flac-1.5.0.tar.gz")
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE "${LOCAL_ARCHIVE}"
|
||||
PATCHES
|
||||
android-cmake.diff
|
||||
fix-compile-options.patch
|
||||
fix-find-threads.patch
|
||||
)
|
||||
|
||||
if("asm" IN_LIST FEATURES)
|
||||
vcpkg_find_acquire_program(NASM)
|
||||
get_filename_component(NASM_PATH "${NASM}" DIRECTORY)
|
||||
vcpkg_add_to_path("${NASM_PATH}")
|
||||
endif()
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
asm WITH_ASM
|
||||
stack-protector WITH_STACK_PROTECTOR
|
||||
multithreading ENABLE_MULTITHREADING
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-DBUILD_PROGRAMS=OFF
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DBUILD_DOCS=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
-DINSTALL_MANPAGES=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME FLAC CONFIG_PATH lib/cmake/FLAC)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/share/LICENSE")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h"
|
||||
"#if defined(FLAC__NO_DLL)"
|
||||
"#if 0"
|
||||
)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h"
|
||||
"#if defined(FLAC__NO_DLL)"
|
||||
"#if 0"
|
||||
)
|
||||
else()
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h"
|
||||
"#if defined(FLAC__NO_DLL)"
|
||||
"#if 1"
|
||||
)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h"
|
||||
"#if defined(FLAC__NO_DLL)"
|
||||
"#if 1"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/flac.pc" " -lm" "")
|
||||
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc" " -lm" "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
# This license (BSD) is relevant only for library - if someone would want to install
|
||||
# FLAC cmd line tools as well additional license (GPL) should be included
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.Xiph")
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
8
Tools/CMake/vcpkg/ports/libflac/usage
Normal file
8
Tools/CMake/vcpkg/ports/libflac/usage
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
The package libflac provides CMake targets:
|
||||
|
||||
find_package(FLAC CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE FLAC::FLAC)
|
||||
|
||||
# Or use the C++ API
|
||||
find_package(FLAC CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE FLAC::FLAC++)
|
||||
37
Tools/CMake/vcpkg/ports/libflac/vcpkg.json
Normal file
37
Tools/CMake/vcpkg/ports/libflac/vcpkg.json
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "libflac",
|
||||
"version": "1.5.0",
|
||||
"description": "Library for manipulating FLAC files",
|
||||
"homepage": "https://xiph.org/flac/",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
"libogg",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
{
|
||||
"name": "stack-protector",
|
||||
"platform": "!emscripten"
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"asm": {
|
||||
"description": "Use any assembly optimization routines",
|
||||
"supports": "x86"
|
||||
},
|
||||
"multithreading": {
|
||||
"description": "Enable multithreading if pthreads is available"
|
||||
},
|
||||
"stack-protector": {
|
||||
"description": "Build with stack smashing protection",
|
||||
"supports": "!emscripten"
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Tools/CMake/vcpkg/ports/libogg/portfile.cmake
Normal file
32
Tools/CMake/vcpkg/ports/libogg/portfile.cmake
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
set(LOCAL_ARCHIVE "$ENV{VCPKG_LIB_SOURCE_ROOT}/xiph-ogg-v1.3.6.tar.gz")
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE "${LOCAL_ARCHIVE}"
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_MINGW)
|
||||
vcpkg_replace_string("${SOURCE_PATH}/win32/ogg.def" "LIBRARY ogg" "LIBRARY libogg")
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 #https://gitlab.xiph.org/xiph/ogg/-/issues/2304
|
||||
-DINSTALL_DOCS=OFF
|
||||
-DINSTALL_PKG_CONFIG_MODULE=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
CMAKE_POLICY_VERSION_MINIMUM
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Ogg PACKAGE_NAME ogg)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
18
Tools/CMake/vcpkg/ports/libogg/vcpkg.json
Normal file
18
Tools/CMake/vcpkg/ports/libogg/vcpkg.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "libogg",
|
||||
"version": "1.3.6",
|
||||
"port-version": 1,
|
||||
"description": "Ogg is a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs.",
|
||||
"homepage": "https://www.xiph.org/ogg",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b501f08..022864f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -855,11 +847,6 @@ if (ENABLE_PACKAGE_CONFIG)
|
||||
${CMAKE_CURRENT_BINARY_DIR}/SndFileConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_PACKAGEDIR}
|
||||
)
|
||||
-
|
||||
- if (NOT BUILD_SHARED_LIBS AND FIND_MODULES_INSTALL_LIST)
|
||||
- file(COPY ${FIND_MODULES_INSTALL_LIST} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
- install(FILES ${FIND_MODULES_INSTALL_LIST} DESTINATION ${CMAKE_INSTALL_PACKAGEDIR})
|
||||
- endif ()
|
||||
else ()
|
||||
|
||||
install (TARGETS sndfile ${sdnfile_PROGRAMS}
|
||||
15
Tools/CMake/vcpkg/ports/libsndfile/mp3lame-static.diff
Normal file
15
Tools/CMake/vcpkg/ports/libsndfile/mp3lame-static.diff
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b501f08..946c321 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -236,6 +236,10 @@ if (INSTALL_PKGCONFIG_MODULE)
|
||||
if (ENABLE_MPEG)
|
||||
set (EXTERNAL_MPEG_REQUIRE "libmpg123")
|
||||
set (EXTERNAL_MPEG_LIBS "-lmp3lame")
|
||||
+ get_target_property(mp3lame_binary mp3lame::mp3lame IMPORTED_LOCATION_RELEASE)
|
||||
+ if(mp3lame_binary MATCHES "mp3lame-static")
|
||||
+ set (EXTERNAL_MPEG_LIBS "-lmp3lame-static -lmpghip-static")
|
||||
+ endif()
|
||||
endif ()
|
||||
|
||||
configure_file (sndfile.pc.in sndfile.pc @ONLY)
|
||||
59
Tools/CMake/vcpkg/ports/libsndfile/portfile.cmake
Normal file
59
Tools/CMake/vcpkg/ports/libsndfile/portfile.cmake
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
set(LOCAL_ARCHIVE "$ENV{VCPKG_LIB_SOURCE_ROOT}/libsndfile-libsndfile-1.2.2.tar.gz")
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE "${LOCAL_ARCHIVE}"
|
||||
PATCHES
|
||||
001-avoid-installing-find-modules.patch
|
||||
mp3lame-static.diff
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
endif()
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
external-libs ENABLE_EXTERNAL_LIBS
|
||||
mpeg ENABLE_MPEG
|
||||
regtest BUILD_REGTEST
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_UWP)
|
||||
set(VCPKG_C_FLAGS "/sdl- ${VCPKG_C_FLAGS}")
|
||||
set(VCPKG_CXX_FLAGS "/sdl- ${VCPKG_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
-DENABLE_BOW_DOCS=OFF
|
||||
-DBUILD_PROGRAMS=OFF
|
||||
-DBUILD_REGTEST=OFF
|
||||
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
|
||||
-DPYTHON_EXECUTABLE=${PYTHON3}
|
||||
${FEATURE_OPTIONS}
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
PYTHON_EXECUTABLE
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake")
|
||||
set(CONFIG_PATH cmake)
|
||||
else()
|
||||
set(CONFIG_PATH lib/cmake/SndFile)
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME SndFile CONFIG_PATH "${CONFIG_PATH}")
|
||||
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
52
Tools/CMake/vcpkg/ports/libsndfile/vcpkg.json
Normal file
52
Tools/CMake/vcpkg/ports/libsndfile/vcpkg.json
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
"name": "libsndfile",
|
||||
"version-semver": "1.2.2",
|
||||
"port-version": 1,
|
||||
"description": "A library for reading and writing audio files",
|
||||
"homepage": "https://github.com/erikd/libsndfile",
|
||||
"license": "LGPL-2.1-or-later",
|
||||
"supports": "!xbox",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
"external-libs",
|
||||
"mpeg"
|
||||
],
|
||||
"features": {
|
||||
"experimental": {
|
||||
"description": "Enable experimental code",
|
||||
"dependencies": [
|
||||
"speex"
|
||||
]
|
||||
},
|
||||
"external-libs": {
|
||||
"description": "Enable FLAC, Vorbis, and Opus codecs",
|
||||
"dependencies": [
|
||||
"libflac",
|
||||
"libvorbis",
|
||||
"opus"
|
||||
]
|
||||
},
|
||||
"mpeg": {
|
||||
"description": "Enable MPEG codecs",
|
||||
"dependencies": [
|
||||
"mp3lame",
|
||||
"mpg123"
|
||||
]
|
||||
},
|
||||
"regtest": {
|
||||
"description": "Build regtest",
|
||||
"dependencies": [
|
||||
"sqlite3"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
160
Tools/CMake/vcpkg/ports/libtheora/CMakeLists.txt
Normal file
160
Tools/CMake/vcpkg/ports/libtheora/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
cmake_minimum_required(VERSION 3.30)
|
||||
project(theora LANGUAGES C)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
|
||||
set(OGG_REQUIRED_VERSION 1.3.4)
|
||||
find_package(Ogg "${OGG_REQUIRED_VERSION}" CONFIG REQUIRED)
|
||||
|
||||
file(GLOB HEADERS
|
||||
"include/theora/codec.h"
|
||||
"include/theora/theora.h"
|
||||
"include/theora/theoradec.h"
|
||||
"include/theora/theoraenc.h"
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
set(LIBTHEORA_COMMON_X86
|
||||
"lib/x86_vc/mmxfrag.c"
|
||||
"lib/x86_vc/mmxidct.c"
|
||||
"lib/x86_vc/mmxstate.c"
|
||||
"lib/x86_vc/x86cpu.c"
|
||||
"lib/x86_vc/x86state.c"
|
||||
)
|
||||
else()
|
||||
set(LIBTHEORA_COMMON_X86
|
||||
"lib/x86/mmxfrag.c"
|
||||
"lib/x86/mmxidct.c"
|
||||
"lib/x86/mmxstate.c"
|
||||
"lib/x86/sse2idct.c"
|
||||
"lib/x86/x86cpu.c"
|
||||
"lib/x86/x86state.c"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(LIBTHEORA_COMMON
|
||||
"lib/apiwrapper.c"
|
||||
"lib/bitpack.c"
|
||||
"lib/dequant.c"
|
||||
"lib/fragment.c"
|
||||
"lib/idct.c"
|
||||
"lib/info.c"
|
||||
"lib/internal.c"
|
||||
"lib/state.c"
|
||||
"lib/quant.c"
|
||||
|
||||
${LIBTHEORA_COMMON_X86}
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
set(LIBTHEORA_ENC_X86
|
||||
"lib/x86_vc/mmxencfrag.c"
|
||||
"lib/x86_vc/mmxfdct.c"
|
||||
"lib/x86_vc/x86enc.c"
|
||||
)
|
||||
else()
|
||||
set(LIBTHEORA_ENC_X86
|
||||
"lib/x86/mmxencfrag.c"
|
||||
"lib/x86/mmxfdct.c"
|
||||
"lib/x86/x86enc.c"
|
||||
"lib/x86/x86enquant.c"
|
||||
"lib/x86/sse2encfrag.c"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(LIBTHEORA_ENC
|
||||
"lib/analyze.c"
|
||||
"lib/encapiwrapper.c"
|
||||
"lib/encfrag.c"
|
||||
"lib/encinfo.c"
|
||||
"lib/encode.c"
|
||||
"lib/enquant.c"
|
||||
"lib/fdct.c"
|
||||
"lib/huffenc.c"
|
||||
"lib/mathops.c"
|
||||
"lib/mcenc.c"
|
||||
"lib/rate.c"
|
||||
"lib/tokenize.c"
|
||||
|
||||
${LIBTHEORA_ENC_X86}
|
||||
)
|
||||
|
||||
set(LIBTHEORA_DEC
|
||||
"lib/decapiwrapper.c"
|
||||
"lib/decinfo.c"
|
||||
"lib/decode.c"
|
||||
"lib/huffdec.c"
|
||||
)
|
||||
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
|
||||
option(USE_X86 "Use x86 optimization" OFF)
|
||||
if(USE_X86)
|
||||
add_definitions(-DOC_X86_ASM)
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_definitions(-DLIBTHEORA_EXPORTS)
|
||||
endif()
|
||||
|
||||
add_library(theora-common OBJECT ${LIBTHEORA_COMMON} ${HEADERS})
|
||||
target_link_libraries(theora-common PUBLIC Ogg::ogg)
|
||||
target_include_directories(theora-common PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
add_library(theora-enc OBJECT ${LIBTHEORA_ENC} ${HEADERS})
|
||||
target_link_libraries(theora-enc PUBLIC Ogg::ogg)
|
||||
target_include_directories(theora-enc PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
add_library(theora-dec OBJECT ${LIBTHEORA_DEC} ${HEADERS})
|
||||
target_link_libraries(theora-dec PUBLIC Ogg::ogg)
|
||||
target_include_directories(theora-dec PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
|
||||
add_library(theora $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> $<TARGET_OBJECTS:theora-dec> "libtheora.def")
|
||||
target_link_libraries(theora PUBLIC Ogg::ogg)
|
||||
target_include_directories(theora PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
|
||||
add_library(theoraenc $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> "win32/xmingw32/libtheoraenc-all.def")
|
||||
target_link_libraries(theoraenc PUBLIC Ogg::ogg)
|
||||
target_include_directories(theoraenc PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
|
||||
add_library(theoradec $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-dec> "win32/xmingw32/libtheoradec-all.def")
|
||||
target_link_libraries(theoradec PUBLIC Ogg::ogg)
|
||||
target_include_directories(theoradec PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
configure_package_config_file(unofficial-theora-config.cmake.in unofficial-theora-config.cmake
|
||||
INSTALL_DESTINATION "lib/unofficial-theora")
|
||||
|
||||
install(FILES ${HEADERS} DESTINATION include/theora)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-theora-config.cmake"
|
||||
DESTINATION "lib/unofficial-theora"
|
||||
)
|
||||
|
||||
install(TARGETS theora theoraenc theoradec
|
||||
EXPORT unofficial-theora-targets
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
|
||||
install(EXPORT unofficial-theora-targets
|
||||
NAMESPACE unofficial::theora::
|
||||
DESTINATION "lib/unofficial-theora"
|
||||
)
|
||||
|
||||
block(SCOPE_FOR VARIABLES)
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(libdir "\${prefix}/lib")
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(includedir "\${prefix}/include")
|
||||
set(THEORA_LIBOGG_REQ_VERSION "${OGG_REQUIRED_VERSION}")
|
||||
configure_file(theora.pc.in theora.pc @ONLY)
|
||||
configure_file(theoradec.pc.in theoradec.pc @ONLY)
|
||||
configure_file(theoraenc.pc.in theoraenc.pc @ONLY)
|
||||
endblock()
|
||||
|
||||
install(
|
||||
FILES "${PROJECT_BINARY_DIR}/theora.pc" "${PROJECT_BINARY_DIR}/theoradec.pc" "${PROJECT_BINARY_DIR}/theoraenc.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
|
||||
)
|
||||
61
Tools/CMake/vcpkg/ports/libtheora/libtheora.def
Normal file
61
Tools/CMake/vcpkg/ports/libtheora/libtheora.def
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
EXPORTS
|
||||
; Old alpha API
|
||||
theora_version_string
|
||||
theora_version_number
|
||||
theora_decode_header
|
||||
theora_decode_init
|
||||
theora_decode_packetin
|
||||
theora_decode_YUVout
|
||||
theora_control
|
||||
theora_packet_isheader
|
||||
theora_packet_iskeyframe
|
||||
theora_granule_shift
|
||||
theora_granule_frame
|
||||
theora_granule_time
|
||||
theora_info_init
|
||||
theora_info_clear
|
||||
theora_clear
|
||||
theora_comment_init
|
||||
theora_comment_add
|
||||
theora_comment_add_tag
|
||||
theora_comment_query
|
||||
theora_comment_query_count
|
||||
theora_comment_clear
|
||||
; New theora-exp API
|
||||
th_version_string
|
||||
th_version_number
|
||||
th_decode_headerin
|
||||
th_decode_alloc
|
||||
th_setup_free
|
||||
th_decode_ctl
|
||||
th_decode_packetin
|
||||
th_decode_ycbcr_out
|
||||
th_decode_free
|
||||
th_packet_isheader
|
||||
th_packet_iskeyframe
|
||||
th_granule_frame
|
||||
th_granule_time
|
||||
th_info_init
|
||||
th_info_clear
|
||||
th_comment_init
|
||||
th_comment_add
|
||||
th_comment_add_tag
|
||||
th_comment_query
|
||||
th_comment_query_count
|
||||
th_comment_clear
|
||||
; Old alpha API
|
||||
theora_encode_init
|
||||
theora_encode_YUVin
|
||||
theora_encode_packetout
|
||||
theora_encode_header
|
||||
theora_encode_comment
|
||||
theora_encode_tables
|
||||
; New theora-exp API
|
||||
th_encode_alloc
|
||||
th_encode_ctl
|
||||
th_encode_flushheader
|
||||
th_encode_ycbcr_in
|
||||
th_encode_packetout
|
||||
th_encode_free
|
||||
TH_VP31_QUANT_INFO
|
||||
TH_VP31_HUFF_CODES
|
||||
32
Tools/CMake/vcpkg/ports/libtheora/portfile.cmake
Normal file
32
Tools/CMake/vcpkg/ports/libtheora/portfile.cmake
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
set(LOCAL_ARCHIVE "$ENV{VCPKG_LIB_SOURCE_ROOT}/xiph-theora-v1.2.0.tar.gz")
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE "${LOCAL_ARCHIVE}"
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/libtheora.def" DESTINATION "${SOURCE_PATH}")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-theora-config.cmake.in" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(THEORA_X86_OPT ON)
|
||||
else()
|
||||
set(THEORA_X86_OPT OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
"-DVERSION:STRING=${VERSION}"
|
||||
-DUSE_X86=${THEORA_X86_OPT}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/unofficial-theora" PACKAGE_NAME "unofficial-theora")
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/LICENSE")
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
@PACKAGE_INIT@
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(Ogg CONFIG)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-theora-targets.cmake")
|
||||
18
Tools/CMake/vcpkg/ports/libtheora/vcpkg.json
Normal file
18
Tools/CMake/vcpkg/ports/libtheora/vcpkg.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "libtheora",
|
||||
"version": "1.2.0",
|
||||
"description": "Theora is a free and open video compression format from the Xiph.org Foundation.",
|
||||
"homepage": "https://github.com/xiph/theora",
|
||||
"license": null,
|
||||
"dependencies": [
|
||||
"libogg",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
diff --git a/win32/vorbis.def b/win32/vorbis.def
|
||||
index 9cca64d..a80fff7 100644
|
||||
--- a/win32/vorbis.def
|
||||
+++ b/win32/vorbis.def
|
||||
@@ -49,11 +49,4 @@ vorbis_synthesis_idheader
|
||||
;
|
||||
vorbis_window
|
||||
;_analysis_output_always
|
||||
-vorbis_encode_init
|
||||
-vorbis_encode_setup_managed
|
||||
-vorbis_encode_setup_vbr
|
||||
-vorbis_encode_init_vbr
|
||||
-vorbis_encode_setup_init
|
||||
-vorbis_encode_ctl
|
||||
-;
|
||||
vorbis_version_string
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index f377c428..07530304 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -60,6 +60,9 @@ message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
|
||||
# Find math library
|
||||
|
||||
check_library_exists(m floor "" HAVE_LIBM)
|
||||
+if(HAVE_LIBM)
|
||||
+ set(VORBIS_LIBS "-lm")
|
||||
+endif()
|
||||
|
||||
# Find ogg dependency
|
||||
find_package(Ogg REQUIRED)
|
||||
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
diff --git a/win32/vorbis.def b/win32/vorbis.def
|
||||
index 1310b6c..de14385 100644
|
||||
--- a/win32/vorbis.def
|
||||
+++ b/win32/vorbis.def
|
||||
@@ -1,6 +1,5 @@
|
||||
; vorbis.def
|
||||
;
|
||||
-LIBRARY
|
||||
EXPORTS
|
||||
_floor_P
|
||||
_mapping_P
|
||||
diff --git a/win32/vorbisenc.def b/win32/vorbisenc.def
|
||||
index 79af064..40a3e39 100644
|
||||
--- a/win32/vorbisenc.def
|
||||
+++ b/win32/vorbisenc.def
|
||||
@@ -1,6 +1,5 @@
|
||||
; vorbisenc.def
|
||||
;
|
||||
-LIBRARY
|
||||
|
||||
EXPORTS
|
||||
vorbis_encode_init
|
||||
diff --git a/win32/vorbisfile.def b/win32/vorbisfile.def
|
||||
index 4dc5549..243795d 100644
|
||||
--- a/win32/vorbisfile.def
|
||||
+++ b/win32/vorbisfile.def
|
||||
@@ -1,6 +1,5 @@
|
||||
; vorbisfile.def
|
||||
;
|
||||
-LIBRARY
|
||||
EXPORTS
|
||||
ov_clear
|
||||
ov_open
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/cmake/VorbisConfig.cmake.in b/cmake/VorbisConfig.cmake.in
|
||||
index 6fc07941..c762ba55 100644
|
||||
--- a/cmake/VorbisConfig.cmake.in
|
||||
+++ b/cmake/VorbisConfig.cmake.in
|
||||
@@ -1,7 +1,7 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
-find_dependency(Ogg REQUIRED)
|
||||
+find_dependency(Ogg CONFIG)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/VorbisTargets.cmake)
|
||||
|
||||
29
Tools/CMake/vcpkg/ports/libvorbis/portfile.cmake
Normal file
29
Tools/CMake/vcpkg/ports/libvorbis/portfile.cmake
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
set(LOCAL_ARCHIVE "$ENV{VCPKG_LIB_SOURCE_ROOT}/xiph-vorbis-v1.3.7.tar.gz")
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE "${LOCAL_ARCHIVE}"
|
||||
PATCHES
|
||||
0001-Dont-export-vorbisenc-functions.patch
|
||||
0002-Fixup-pkgconfig-libs.patch
|
||||
0003-def-mingw-compat.patch
|
||||
0004-ogg-find-dependency.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 # https://github.com/xiph/vorbis/issues/113
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
CMAKE_POLICY_VERSION_MINIMUM
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME Vorbis CONFIG_PATH "lib/cmake/Vorbis")
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
13
Tools/CMake/vcpkg/ports/libvorbis/usage
Normal file
13
Tools/CMake/vcpkg/ports/libvorbis/usage
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
The package libvorbis provides CMake targets:
|
||||
|
||||
# Vorbis reference encoder and decoder, low-level API
|
||||
find_package(Vorbis CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE Vorbis::vorbis)
|
||||
|
||||
# Audio stream decoding and basic manipulation, high-level API
|
||||
find_package(Vorbis CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE Vorbis::vorbisfile)
|
||||
|
||||
# Convenience API for setting up an encoding environment
|
||||
find_package(Vorbis CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE Vorbis::vorbisenc)
|
||||
19
Tools/CMake/vcpkg/ports/libvorbis/vcpkg.json
Normal file
19
Tools/CMake/vcpkg/ports/libvorbis/vcpkg.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "libvorbis",
|
||||
"version": "1.3.7",
|
||||
"port-version": 4,
|
||||
"description": "Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format",
|
||||
"homepage": "https://github.com/xiph/vorbis",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
"libogg",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
15
Tools/CMake/vcpkg/ports/opus/fix-pkgconfig-version.patch
Normal file
15
Tools/CMake/vcpkg/ports/opus/fix-pkgconfig-version.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/cmake/OpusPackageVersion.cmake b/cmake/OpusPackageVersion.cmake
|
||||
index 447ce3b..15ebd8e 100644
|
||||
--- a/cmake/OpusPackageVersion.cmake
|
||||
+++ b/cmake/OpusPackageVersion.cmake
|
||||
@@ -4,7 +4,9 @@ endif()
|
||||
set(__opus_version INCLUDED)
|
||||
|
||||
function(get_package_version PACKAGE_VERSION PROJECT_VERSION)
|
||||
-
|
||||
+ set(PACKAGE_VERSION "0" CACHE STRING "opus package version")
|
||||
+ set(PROJECT_VERSION "0" CACHE STRING "opus project version")
|
||||
+ return()
|
||||
find_package(Git)
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE}
|
||||
57
Tools/CMake/vcpkg/ports/opus/portfile.cmake
Normal file
57
Tools/CMake/vcpkg/ports/opus/portfile.cmake
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
set(LOCAL_ARCHIVE "$ENV{VCPKG_LIB_SOURCE_ROOT}/xiph-opus-v1.5.2.tar.gz")
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE "${LOCAL_ARCHIVE}"
|
||||
PATCHES fix-pkgconfig-version.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
avx2 AVX2_SUPPORTED
|
||||
)
|
||||
|
||||
set(STACK_PROTECTOR ON)
|
||||
set(ADDITIONAL_OPUS_OPTIONS "")
|
||||
if(VCPKG_TARGET_IS_MINGW)
|
||||
set(STACK_PROTECTOR OFF)
|
||||
string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0")
|
||||
string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0")
|
||||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)64$")
|
||||
list(APPEND ADDITIONAL_OPUS_OPTIONS "-DOPUS_USE_NEON=OFF") # for version 1.3.1 (remove for future Opus release)
|
||||
list(APPEND ADDITIONAL_OPUS_OPTIONS "-DOPUS_DISABLE_INTRINSICS=ON") # for HEAD (and future Opus release)
|
||||
endif()
|
||||
elseif(VCPKG_TARGET_IS_WINDOWS)
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL "static")
|
||||
list(APPEND ADDITIONAL_OPUS_OPTIONS "-DOPUS_STATIC_RUNTIME=ON")
|
||||
endif()
|
||||
elseif(VCPKG_TARGET_IS_EMSCRIPTEN)
|
||||
set(STACK_PROTECTOR OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS ${FEATURE_OPTIONS}
|
||||
-DPACKAGE_VERSION=${VERSION}
|
||||
-DOPUS_STACK_PROTECTOR=${STACK_PROTECTOR}
|
||||
-DOPUS_INSTALL_PKG_CONFIG_MODULE=ON
|
||||
-DOPUS_INSTALL_CMAKE_CONFIG_MODULE=ON
|
||||
-DOPUS_BUILD_PROGRAMS=OFF
|
||||
-DOPUS_BUILD_TESTING=OFF
|
||||
${ADDITIONAL_OPUS_OPTIONS}
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
OPUS_USE_NEON
|
||||
OPUS_DISABLE_INTRINSICS
|
||||
)
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Opus)
|
||||
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
|
||||
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/cmake"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
23
Tools/CMake/vcpkg/ports/opus/vcpkg.json
Normal file
23
Tools/CMake/vcpkg/ports/opus/vcpkg.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "opus",
|
||||
"version": "1.5.2",
|
||||
"port-version": 1,
|
||||
"description": "Totally open, royalty-free, highly versatile audio codec",
|
||||
"homepage": "https://github.com/xiph/opus",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"avx2": {
|
||||
"description": "Builds the library with avx2 instruction set"
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Tools/CMake/vcpkg/triplets/universal-osx-11-release.cmake
Normal file
19
Tools/CMake/vcpkg/triplets/universal-osx-11-release.cmake
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE arm64)
|
||||
|
||||
if(${PORT} MATCHES "sdl2|openal-soft|libsndfile")
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
else()
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
||||
set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64")
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_VERSION 11.0)
|
||||
set(VCPKG_OSX_DEPLOYMENT_TARGET 11.0)
|
||||
set(VCPKG_C_FLAGS -mmacosx-version-min=11.0)
|
||||
set(VCPKG_CXX_FLAGS -mmacosx-version-min=11.0)
|
||||
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
17
Tools/CMake/vcpkg/triplets/universal-osx-11.cmake
Normal file
17
Tools/CMake/vcpkg/triplets/universal-osx-11.cmake
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE arm64)
|
||||
|
||||
if(${PORT} MATCHES "sdl2|openal-soft|libsndfile")
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
else()
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
||||
set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64")
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_VERSION 11.0)
|
||||
set(VCPKG_OSX_DEPLOYMENT_TARGET 11.0)
|
||||
set(VCPKG_C_FLAGS -mmacosx-version-min=11.0)
|
||||
set(VCPKG_CXX_FLAGS -mmacosx-version-min=11.0)
|
||||
12
Tools/CMake/vcpkg/triplets/x64-linux-mixed-release.cmake
Normal file
12
Tools/CMake/vcpkg/triplets/x64-linux-mixed-release.cmake
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
|
||||
if(${PORT} MATCHES "sdl2|openal-soft|libsndfile")
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
else()
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
11
Tools/CMake/vcpkg/triplets/x64-linux-mixed.cmake
Normal file
11
Tools/CMake/vcpkg/triplets/x64-linux-mixed.cmake
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
|
||||
if(${PORT} MATCHES "sdl2|openal-soft|libsndfile")
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
else()
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
|
||||
11
Tools/CMake/vcpkg/triplets/x64-windows-mixed-release.cmake
Normal file
11
Tools/CMake/vcpkg/triplets/x64-windows-mixed-release.cmake
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
|
||||
if(${PORT} MATCHES "sdl2|openal-soft|libsndfile")
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
else()
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
9
Tools/CMake/vcpkg/triplets/x64-windows-mixed.cmake
Normal file
9
Tools/CMake/vcpkg/triplets/x64-windows-mixed.cmake
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
|
||||
if(${PORT} MATCHES "sdl2|openal-soft|libsndfile")
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
else()
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
Loading…
Add table
Add a link
Reference in a new issue