diff options
| author | Ashik Salim <ashikns@gmail.com> | 2018-04-20 02:56:48 +0530 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-04-19 14:26:47 -0700 |
| commit | 12e21abfc77ce6b68fd47ac6faa6722e80d22977 (patch) | |
| tree | a1285fe6cad129629e271f0a6d8a853db8de50f8 | |
| parent | 60e63d34472819af88bd0f4aa4ca5b502775cf04 (diff) | |
| download | vcpkg-12e21abfc77ce6b68fd47ac6faa6722e80d22977.tar.gz vcpkg-12e21abfc77ce6b68fd47ac6faa6722e80d22977.zip | |
[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
| -rw-r--r-- | ports/x264/CONTROL | 2 | ||||
| -rw-r--r-- | ports/x264/portfile.cmake | 20 | ||||
| -rw-r--r-- | ports/x264/uwp-cflags.patch | 12 |
3 files changed, 31 insertions, 3 deletions
diff --git a/ports/x264/CONTROL b/ports/x264/CONTROL index b9a3a4f9b..245fb8f7f 100644 --- a/ports/x264/CONTROL +++ b/ports/x264/CONTROL @@ -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 diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index b9dbfa34d..d5f85ecdd 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -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 diff --git a/ports/x264/uwp-cflags.patch b/ports/x264/uwp-cflags.patch new file mode 100644 index 000000000..fd04755bc --- /dev/null +++ b/ports/x264/uwp-cflags.patch @@ -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"
|
