[x264] Fix compilation for uwp (#3270)

* [x264] borrow some code from ffmpeg portfile to fix compilation for uwp

* [x264] Fix uwp configure instead of removing -RTC1
This commit is contained in:
Ashik Salim 2018-04-20 02:56:48 +05:30 committed by Robert Schumacher
parent 60e63d3447
commit 12e21abfc7
3 changed files with 31 additions and 3 deletions

View File

@ -1,3 +1,3 @@
Source: x264
Version: 152-e9a5903edf8ca59
Version: 152-e9a5903edf8ca59-1
Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format

View File

@ -10,6 +10,12 @@ vcpkg_from_github(
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/uwp-cflags.patch
)
# Acquire tools
vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15)
@ -25,10 +31,18 @@ set(CONFIGURE_OPTIONS "--host=i686-pc-mingw32 --enable-strip --disable-lavf --di
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --enable-shared")
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib")
endif()
else()
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --enable-static")
endif()
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\")
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00")
endif()
set(CONFIGURE_OPTIONS_RELEASE "--prefix=${CURRENT_PACKAGES_DIR}")
set(CONFIGURE_OPTIONS_DEBUG "--enable-debug --prefix=${CURRENT_PACKAGES_DIR}/debug")
@ -86,8 +100,10 @@ vcpkg_execute_required_process(
LOGNAME "build-${TARGET_TRIPLET}-dbg")
message(STATUS "Package ${TARGET_TRIPLET}-dbg done")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/x264)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x264.exe ${CURRENT_PACKAGES_DIR}/tools/x264/x264.exe)
if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/x264)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x264.exe ${CURRENT_PACKAGES_DIR}/tools/x264/x264.exe)
endif()
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/lib/pkgconfig

View File

@ -0,0 +1,12 @@
diff --git a/configure b/configure
index f7b14d9..2c92b2a 100644
--- a/configure
+++ b/configure
@@ -821,7 +821,6 @@ if [ $SYS = WINDOWS ]; then
if cpp_check "winapifamily.h" "" "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" ; then
[ $compiler = CL ] || die "WinRT requires MSVC"
define HAVE_WINRT
- CFLAGS="$CFLAGS -MD"
LDFLAGS="$LDFLAGS -appcontainer"
if ! cpp_check "" "" "defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0603" ; then
die "_WIN32_WINNT must be defined to at least 0x0603 (Windows 8.1) for WinRT"