Skip to content

Commit

Permalink
[vcpkg] Fix build type in vcpkg_build_make.cmake (#9602)
Browse files Browse the repository at this point in the history
* [vcpkg] Fix build type in vcpkg_build_make.cmake

* Update x264 and libosip to test vcpkg_build_make() function

* [x264] Update portfile.cmake
  • Loading branch information
NancyLi1013 authored and ras0219-msft committed Jan 14, 2020
1 parent 299c7c7 commit 066c7b9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 39 deletions.
2 changes: 1 addition & 1 deletion ports/libosip2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libosip2
Version: 5.1.0-2
Version: 5.1.0-3
Homepage: https://www.gnu.org/software/osip/
Description: oSIP is an LGPL implementation of SIP. It's stable, portable, flexible and compliant! -may be more-! It is used mostly with eXosip2 stack (GPL) which provides simpler API for User-Agent implementation.
4 changes: 2 additions & 2 deletions ports/x264/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: x264
Version: 157-303c484ec828ed0-6
Version: 157-303c484ec828ed0-7
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
Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format
11 changes: 3 additions & 8 deletions ports/x264/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
include(vcpkg_common_functions)

set(X264_VERSION 157)

if (NOT VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "x264 only support windows.")
endif()
vcpkg_fail_port_install(ON_TARGET "Linux" "OSX")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
Expand Down Expand Up @@ -32,7 +28,7 @@ vcpkg_configure_make(

vcpkg_install_make()

if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(NOT VCPKG_TARGET_IS_UWP)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/x264)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x264.exe ${CURRENT_PACKAGES_DIR}/tools/x264/x264.exe)
endif()
Expand Down Expand Up @@ -61,5 +57,4 @@ endif()

vcpkg_copy_pdbs()

file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/x264)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/x264/COPYING ${CURRENT_PACKAGES_DIR}/share/x264/copyright)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
58 changes: 30 additions & 28 deletions scripts/cmake/vcpkg_build_make.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -142,37 +142,39 @@ function(vcpkg_build_make)

if (_bc_ENABLE_INSTALL)
foreach(BUILDTYPE "debug" "release")
if(BUILDTYPE STREQUAL "debug")
# Skip debug generate
if (_VCPKG_NO_DEBUG)
continue()
endif()
set(SHORT_BUILDTYPE "-dbg")
else()
# In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
if (_VCPKG_NO_DEBUG)
set(SHORT_BUILDTYPE "")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE)
if(BUILDTYPE STREQUAL "debug")
# Skip debug generate
if (_VCPKG_NO_DEBUG)
continue()
endif()
set(SHORT_BUILDTYPE "-dbg")
else()
set(SHORT_BUILDTYPE "-rel")
# In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
if (_VCPKG_NO_DEBUG)
set(SHORT_BUILDTYPE "")
else()
set(SHORT_BUILDTYPE "-rel")
endif()
endif()
endif()

message(STATUS "Installing ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
if (CMAKE_HOST_WIN32)
# In windows we can remotely call make
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE})
vcpkg_execute_build_process(
COMMAND "${MAKE} ${INSTALL_OPTS}"
WORKING_DIRECTORY ${WORKING_DIRECTORY}
LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
)
else()
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_VCPKG_PROJECT_SUBPATH})
vcpkg_execute_build_process(
COMMAND "${MAKE};${INSTALL_OPTS}"
WORKING_DIRECTORY ${WORKING_DIRECTORY}
LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
)
message(STATUS "Installing ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
if (CMAKE_HOST_WIN32)
# In windows we can remotely call make
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE})
vcpkg_execute_build_process(
COMMAND "${MAKE} ${INSTALL_OPTS}"
WORKING_DIRECTORY ${WORKING_DIRECTORY}
LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
)
else()
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_VCPKG_PROJECT_SUBPATH})
vcpkg_execute_build_process(
COMMAND "${MAKE};${INSTALL_OPTS}"
WORKING_DIRECTORY ${WORKING_DIRECTORY}
LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
)
endif()
endif()
endforeach()
endif()
Expand Down

0 comments on commit 066c7b9

Please sign in to comment.