-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#9467) libvpx: fix Visual Studio 2022 build + modernize
* modernize * relocatable shared lib on macOS * workaround for macOS M1 in test package * disable whole optimization for msvc * extend support for Visual Studio 2022 & Apple platforms * libvpx has a C API implementation is in C also, except one compilation unit in C++, so we keep compiler.libcxx & compiler.cppstd * package proper lib if msvc & debug also honor upstream lib name * check CFLAGS to disable lto for msvc
- Loading branch information
Showing
10 changed files
with
266 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
sources: | ||
"1.9.0": | ||
url: "https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz" | ||
sha256: "d279c10e4b9316bf11a570ba16c3d55791e1ad6faa4404c67422eb631782c80a" | ||
"1.10.0": | ||
url: "https://github.com/webmproject/libvpx/archive/v1.10.0.tar.gz" | ||
sha256: "85803ccbdbdd7a3b03d930187cb055f1353596969c1f92ebec2db839fa4f834a" | ||
"1.11.0": | ||
url: "https://github.com/webmproject/libvpx/archive/v1.11.0.tar.gz" | ||
sha256: "965e51c91ad9851e2337aebcc0f517440c637c506f3a03948062e3d5ea129a83" | ||
"1.10.0": | ||
url: "https://github.com/webmproject/libvpx/archive/v1.10.0.tar.gz" | ||
sha256: "85803ccbdbdd7a3b03d930187cb055f1353596969c1f92ebec2db839fa4f834a" | ||
"1.9.0": | ||
url: "https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz" | ||
sha256: "d279c10e4b9316bf11a570ba16c3d55791e1ad6faa4404c67422eb631782c80a" | ||
patches: | ||
"1.11.0": | ||
- patch_file: "patches/0001-extended-support-1.10.0.patch" | ||
base_path: "source_subfolder" | ||
"1.10.0": | ||
- patch_file: "patches/0001-extended-support-1.10.0.patch" | ||
base_path: "source_subfolder" | ||
"1.9.0": | ||
- patch_file: "patches/msvc_conan_build.patch" | ||
- patch_file: "patches/0001-extended-support-1.9.0.patch" | ||
base_path: "source_subfolder" | ||
- patch_file: "patches/0002-msvc_conan_build.patch" | ||
base_path: "source_subfolder" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
recipes/libvpx/all/patches/0001-extended-support-1.10.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- a/build/make/configure.sh | ||
+++ b/build/make/configure.sh | ||
@@ -774,7 +774,7 @@ process_common_toolchain() { | ||
tgt_isa=x86_64 | ||
tgt_os=`echo $gcctarget | sed 's/.*\(darwin1[0-9]\).*/\1/'` | ||
;; | ||
- *darwin20*) | ||
+ *darwin2[0-1]*) | ||
tgt_isa=`uname -m` | ||
tgt_os=`echo $gcctarget | sed 's/.*\(darwin2[0-9]\).*/\1/'` | ||
;; | ||
@@ -918,9 +918,9 @@ process_common_toolchain() { | ||
add_cflags "-mmacosx-version-min=10.15" | ||
add_ldflags "-mmacosx-version-min=10.15" | ||
;; | ||
- *-darwin20-*) | ||
- add_cflags "-mmacosx-version-min=10.16 -arch ${toolchain%%-*}" | ||
- add_ldflags "-mmacosx-version-min=10.16 -arch ${toolchain%%-*}" | ||
+ *-darwin2[0-1]-*) | ||
+ add_cflags "-arch ${toolchain%%-*}" | ||
+ add_ldflags "-arch ${toolchain%%-*}" | ||
;; | ||
*-iphonesimulator-*) | ||
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}" | ||
--- a/build/make/gen_msvs_sln.sh | ||
+++ b/build/make/gen_msvs_sln.sh | ||
@@ -219,6 +219,7 @@ for opt in "$@"; do | ||
14) vs_year=2015 ;; | ||
15) vs_year=2017 ;; | ||
16) vs_year=2019 ;; | ||
+ 17) vs_year=2022 ;; | ||
*) die Unrecognized Visual Studio Version in $opt ;; | ||
esac | ||
;; | ||
@@ -232,7 +233,7 @@ done | ||
outfile=${outfile:-/dev/stdout} | ||
mkoutfile=${mkoutfile:-/dev/stdout} | ||
case "${vs_ver}" in | ||
- 1[4-6]) | ||
+ 1[4-7]) | ||
# VS has used Format Version 12.00 continuously since vs11. | ||
sln_vers="12.00" | ||
sln_vers_str="Visual Studio ${vs_year}" | ||
--- a/build/make/gen_msvs_vcxproj.sh | ||
+++ b/build/make/gen_msvs_vcxproj.sh | ||
@@ -170,7 +170,7 @@ for opt in "$@"; do | ||
--ver=*) | ||
vs_ver="$optval" | ||
case "$optval" in | ||
- 1[4-6]) | ||
+ 1[4-7]) | ||
;; | ||
*) die Unrecognized Visual Studio Version in $opt | ||
;; | ||
@@ -344,6 +344,9 @@ generate_vcxproj() { | ||
if [ "$vs_ver" = "16" ]; then | ||
tag_content PlatformToolset v142 | ||
fi | ||
+ if [ "$vs_ver" = "17" ]; then | ||
+ tag_content PlatformToolset v143 | ||
+ fi | ||
tag_content CharacterSet Unicode | ||
if [ "$config" = "Release" ]; then | ||
tag_content WholeProgramOptimization true | ||
--- a/configure | ||
+++ b/configure | ||
@@ -100,6 +100,7 @@ EOF | ||
all_platforms="${all_platforms} arm64-android-gcc" | ||
all_platforms="${all_platforms} arm64-darwin-gcc" | ||
all_platforms="${all_platforms} arm64-darwin20-gcc" | ||
+all_platforms="${all_platforms} arm64-darwin21-gcc" | ||
all_platforms="${all_platforms} arm64-linux-gcc" | ||
all_platforms="${all_platforms} arm64-win64-gcc" | ||
all_platforms="${all_platforms} arm64-win64-vs15" | ||
@@ -139,6 +140,7 @@ all_platforms="${all_platforms} x86-win32-gcc" | ||
all_platforms="${all_platforms} x86-win32-vs14" | ||
all_platforms="${all_platforms} x86-win32-vs15" | ||
all_platforms="${all_platforms} x86-win32-vs16" | ||
+all_platforms="${all_platforms} x86-win32-vs17" | ||
all_platforms="${all_platforms} x86_64-android-gcc" | ||
all_platforms="${all_platforms} x86_64-darwin9-gcc" | ||
all_platforms="${all_platforms} x86_64-darwin10-gcc" | ||
@@ -152,6 +154,7 @@ all_platforms="${all_platforms} x86_64-darwin17-gcc" | ||
all_platforms="${all_platforms} x86_64-darwin18-gcc" | ||
all_platforms="${all_platforms} x86_64-darwin19-gcc" | ||
all_platforms="${all_platforms} x86_64-darwin20-gcc" | ||
+all_platforms="${all_platforms} x86_64-darwin21-gcc" | ||
all_platforms="${all_platforms} x86_64-iphonesimulator-gcc" | ||
all_platforms="${all_platforms} x86_64-linux-gcc" | ||
all_platforms="${all_platforms} x86_64-linux-icc" | ||
@@ -160,6 +163,7 @@ all_platforms="${all_platforms} x86_64-win64-gcc" | ||
all_platforms="${all_platforms} x86_64-win64-vs14" | ||
all_platforms="${all_platforms} x86_64-win64-vs15" | ||
all_platforms="${all_platforms} x86_64-win64-vs16" | ||
+all_platforms="${all_platforms} x86_64-win64-vs17" | ||
all_platforms="${all_platforms} generic-gnu" | ||
|
||
# all_targets is a list of all targets that can be configured |
58 changes: 58 additions & 0 deletions
58
recipes/libvpx/all/patches/0001-extended-support-1.9.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- a/build/make/gen_msvs_sln.sh | ||
+++ b/build/make/gen_msvs_sln.sh | ||
@@ -219,6 +219,7 @@ for opt in "$@"; do | ||
14) vs_year=2015 ;; | ||
15) vs_year=2017 ;; | ||
16) vs_year=2019 ;; | ||
+ 17) vs_year=2022 ;; | ||
*) die Unrecognized Visual Studio Version in $opt ;; | ||
esac | ||
;; | ||
@@ -232,7 +233,7 @@ done | ||
outfile=${outfile:-/dev/stdout} | ||
mkoutfile=${mkoutfile:-/dev/stdout} | ||
case "${vs_ver}" in | ||
- 1[4-6]) | ||
+ 1[4-7]) | ||
# VS has used Format Version 12.00 continuously since vs11. | ||
sln_vers="12.00" | ||
sln_vers_str="Visual Studio ${vs_year}" | ||
--- a/build/make/gen_msvs_vcxproj.sh | ||
+++ b/build/make/gen_msvs_vcxproj.sh | ||
@@ -168,7 +168,7 @@ for opt in "$@"; do | ||
--ver=*) | ||
vs_ver="$optval" | ||
case "$optval" in | ||
- 1[4-6]) | ||
+ 1[4-7]) | ||
;; | ||
*) die Unrecognized Visual Studio Version in $opt | ||
;; | ||
@@ -342,6 +342,9 @@ generate_vcxproj() { | ||
if [ "$vs_ver" = "16" ]; then | ||
tag_content PlatformToolset v142 | ||
fi | ||
+ if [ "$vs_ver" = "17" ]; then | ||
+ tag_content PlatformToolset v143 | ||
+ fi | ||
tag_content CharacterSet Unicode | ||
if [ "$config" = "Release" ]; then | ||
tag_content WholeProgramOptimization true | ||
--- a/configure | ||
+++ b/configure | ||
@@ -138,6 +138,7 @@ all_platforms="${all_platforms} x86-win32-gcc" | ||
all_platforms="${all_platforms} x86-win32-vs14" | ||
all_platforms="${all_platforms} x86-win32-vs15" | ||
all_platforms="${all_platforms} x86-win32-vs16" | ||
+all_platforms="${all_platforms} x86-win32-vs17" | ||
all_platforms="${all_platforms} x86_64-android-gcc" | ||
all_platforms="${all_platforms} x86_64-darwin9-gcc" | ||
all_platforms="${all_platforms} x86_64-darwin10-gcc" | ||
@@ -158,6 +159,7 @@ all_platforms="${all_platforms} x86_64-win64-gcc" | ||
all_platforms="${all_platforms} x86_64-win64-vs14" | ||
all_platforms="${all_platforms} x86_64-win64-vs15" | ||
all_platforms="${all_platforms} x86_64-win64-vs16" | ||
+all_platforms="${all_platforms} x86_64-win64-vs17" | ||
all_platforms="${all_platforms} generic-gnu" | ||
|
||
# all_targets is a list of all targets that can be configured |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package) | ||
|
||
project(test_package C) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(libvpx REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) | ||
add_executable(${PROJECT_NAME} test_package.c) | ||
target_link_libraries(${PROJECT_NAME} libvpx::libvpx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <vpx/vpx_codec.h> | ||
|
||
#include <stdio.h> | ||
|
||
int main() | ||
{ | ||
printf("vpx version %s\n", vpx_codec_version_str()); | ||
return 0; | ||
} |
Oops, something went wrong.