Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[x264] enable cross-compile settings propagation for arm64-linux. #22900

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions ports/x264/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,35 @@ if(VCPKG_TARGET_IS_LINUX)
list(APPEND OPTIONS --enable-pic)
endif()

vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")

if (VCPKG_DETECTED_CMAKE_CROSSCOMPILING STREQUAL "TRUE")
if (VCPKG_TARGET_IS_LINUX)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
list(APPEND OPTIONS --host=aarch64-linux)
if (DEFINED ENV{CROSS_PREFIX})
# allow toolchain to specify the cross-prefix
set(cross_prefix $ENV{CROSS_PREFIX})
else()
# attempt to determine the cross-prefix from VCPKG_DETECTED_CMAKE_C/CXX_COMPILER using the most likely naming conventions
if (${VCPKG_DETECTED_CMAKE_C_COMPILER} MATCHES ".*-gcc")
string(REGEX REPLACE "gcc$" "" full_cross_prefix ${VCPKG_DETECTED_CMAKE_C_COMPILER})
get_filename_component(cross_prefix ${full_cross_prefix} NAME)
elseif (${VCPKG_DETECTED_CMAKE_CXX_COMPILER} MATCHES ".*-g\\+\\+")
string(REGEX REPLACE "g\\+\\+$" "" full_cross_prefix ${VCPKG_DETECTED_CMAKE_CXX_COMPILER})
get_filename_component(cross_prefix ${full_cross_prefix} NAME)
else()
message(AUTHOR_WARNING "Could not self-determine cross-prefix. Will attempt to use 'aarch64-linux-gnu-'. You should use ENV{CROSS_PREFIX} in your toolchain to override it.")
set(cross_prefix "aarch64-linux-gnu-")
endif()
endif()
list(APPEND OPTIONS --cross-prefix=${cross_prefix})
list(APPEND OPTIONS --disable-asm)
endif()
endif()
endif()

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
NO_ADDITIONAL_PATHS
Expand Down
6 changes: 5 additions & 1 deletion ports/x264/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"name": "x264",
"version-string": "164-5db6aa6cab1b146",
"port-version": 4,
"port-version": 5,
"description": "x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format",
"homepage": "https://github.com/mirror/x264",
"supports": "!(arm & windows)",
"dependencies": [
{
"name": "pthread",
"platform": "linux & osx"
},
{
"name": "vcpkg-cmake",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7366,7 +7366,7 @@
},
"x264": {
"baseline": "164-5db6aa6cab1b146",
"port-version": 4
"port-version": 5
},
"x265": {
"baseline": "3.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/x-/x264.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "063705300826104f0616ff931ff1b0dadb279c77",
"version-string": "164-5db6aa6cab1b146",
"port-version": 5
},
{
"git-tree": "7eea109502309e62a578bcc69811ad0659e00f9d",
"version-string": "164-5db6aa6cab1b146",
Expand Down