aboutsummaryrefslogtreecommitdiff
path: root/ports/x264
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-10-05 22:51:07 +0800
committerCurtis J Bezault <curtbezault@gmail.com>2019-10-05 07:51:07 -0700
commitad493fd8600c13f75dabcad60e6bd8d644f83c6b (patch)
tree5ab2aef7c42141bc4b0fb36d155fe178e4cb6742 /ports/x264
parent47c6b3f557f305969bb271d10ad4b0b0d936ad23 (diff)
downloadvcpkg-ad493fd8600c13f75dabcad60e6bd8d644f83c6b.tar.gz
vcpkg-ad493fd8600c13f75dabcad60e6bd8d644f83c6b.zip
Add function vcpkg_configure_make/vcpkg_build_make/vcpkg_install_make/vcpkg_build_nmake/vcpkg_install_nmake (#8267)
* Add function vcpkg_configure_make/vcpkg_build_make. * Fix autoreconf command and add log. * Add vcpkg_install_make. * Fix call function name. * support non-debug mode. * Add nmake support. * [tcl]Add new port for testing. * [vcpkg_configure_make]Fix prefix in linux. * restart CI systen. * Separate vcpkg_build_nmake/vcpkg_install_nmake. Add arg PROJECT_NAME. * fix copy source file. add samples. * Remove uncommon options. Add force install para to autoreconf. * fix build error. * fix options judgment. * enable nmake in windows. * fix some envs and macros. Disable NMAKE in vcpkg_configure_make currently. * update docs. * fix environments. * Modify libosip2 to use vcpkg_configure_make/vcpkg_install_make. * [tcl]Tcl separates PR. * trigger PR-EAGER. * [freexl]Fix options name and remove option NMAKE. * use tool-chain instead of set environments manually. * fix autoreconf para. * use vcpkg_execute_build_process instead.
Diffstat (limited to 'ports/x264')
-rw-r--r--ports/x264/CONTROL2
-rw-r--r--ports/x264/portfile.cmake110
2 files changed, 19 insertions, 93 deletions
diff --git a/ports/x264/CONTROL b/ports/x264/CONTROL
index ef3e80bcb..59098837d 100644
--- a/ports/x264/CONTROL
+++ b/ports/x264/CONTROL
@@ -1,4 +1,4 @@
Source: x264
-Version: 157-303c484ec828ed0-2
+Version: 157-303c484ec828ed0-3
Homepage: https://github.com/mirror/x264
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 4dfb43683..ea72b2ad2 100644
--- a/ports/x264/portfile.cmake
+++ b/ports/x264/portfile.cmake
@@ -2,6 +2,10 @@ include(vcpkg_common_functions)
set(X264_VERSION 157)
+if (NOT VCPKG_TARGET_IS_WINDOWS)
+ message(FATAL_ERROR "x264 only support windows.")
+endif()
+
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mirror/x264
@@ -12,99 +16,21 @@ vcpkg_from_github(
"uwp-cflags.patch"
)
-# Acquire tools
-vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15)
-
-if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86 OR VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
- vcpkg_find_acquire_program(NASM)
- get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
- set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}")
-endif()
-
-# Insert msys into the path between the compiler toolset and windows system32. This prevents masking of "link.exe" but DOES mask "find.exe".
-string(REPLACE ";$ENV{SystemRoot}\\system32;" ";${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\system32;" NEWPATH "$ENV{PATH}")
-set(ENV{PATH} "${NEWPATH}")
-set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
-
-set(AUTOMAKE_DIR ${MSYS_ROOT}/usr/share/automake-1.15)
-#file(COPY ${AUTOMAKE_DIR}/config.guess ${AUTOMAKE_DIR}/config.sub DESTINATION ${SOURCE_PATH}/source)
-
-set(CONFIGURE_OPTIONS "--host=i686-pc-mingw32 --enable-strip --disable-lavf --disable-swscale --disable-avs --disable-ffms --disable-gpac --disable-lsmash")
-
-if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x86 AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
- set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --disable-asm")
-endif()
-
-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")
-
-if(VCPKG_CRT_LINKAGE STREQUAL "static")
- set(X264_RUNTIME "-MT")
-else()
- set(X264_RUNTIME "-MD")
-endif()
-
-# Configure release
-message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
-file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
-file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
-set(ENV{CFLAGS} "${X264_RUNTIME} -O2 -Oi -Zi")
-set(ENV{CXXFLAGS} "${X264_RUNTIME} -O2 -Oi -Zi")
-set(ENV{LDFLAGS} "-DEBUG -INCREMENTAL:NO -OPT:REF -OPT:ICF")
-vcpkg_execute_required_process(
- COMMAND ${BASH} --noprofile --norc -c
- "CC=cl ${SOURCE_PATH}/configure ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_RELEASE}"
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
- LOGNAME "configure-${TARGET_TRIPLET}-rel")
-message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
-
-# Configure debug
-message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
-file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
-file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
-set(ENV{CFLAGS} "${X264_RUNTIME}d -Od -Zi -RTC1")
-set(ENV{CXXFLAGS} "${X264_RUNTIME}d -Od -Zi -RTC1")
-set(ENV{LDFLAGS} "-DEBUG")
-vcpkg_execute_required_process(
- COMMAND ${BASH} --noprofile --norc -c
- "CC=cl ${SOURCE_PATH}/configure ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_DEBUG}"
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
- LOGNAME "configure-${TARGET_TRIPLET}-dbg")
-message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")
-
-unset(ENV{CFLAGS})
-unset(ENV{CXXFLAGS})
-unset(ENV{LDFLAGS})
-
-# Build release
-message(STATUS "Package ${TARGET_TRIPLET}-rel")
-vcpkg_execute_required_process(
- COMMAND ${BASH} --noprofile --norc -c "make && make install"
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
- LOGNAME "build-${TARGET_TRIPLET}-rel")
-message(STATUS "Package ${TARGET_TRIPLET}-rel done")
+vcpkg_configure_make(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ --enable-strip
+ --disable-lavf
+ --disable-swscale
+ --disable-avs
+ --disable-ffms
+ --disable-gpac
+ --disable-lsmash
+ --disable-asm
+ --enable-debug
+)
-# Build debug
-message(STATUS "Package ${TARGET_TRIPLET}-dbg")
-vcpkg_execute_required_process(
- COMMAND ${BASH} --noprofile --norc -c "make && make install"
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
- LOGNAME "build-${TARGET_TRIPLET}-dbg")
-message(STATUS "Package ${TARGET_TRIPLET}-dbg done")
+vcpkg_install_make()
if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/x264)