From f3e317b16f95184861ede6489cc33e17b83e352f Mon Sep 17 00:00:00 2001 From: JackBoosY <47264268+JackBoosY@users.noreply.github.com> Date: Tue, 8 Oct 2019 19:43:23 +0800 Subject: [PATCH] Add project declaration and fix linux installation. (#8495) --- ports/yoga/CONTROL | 2 +- ports/yoga/add-project-declaration.patch | 13 +++++++++++++ ports/yoga/portfile.cmake | 18 ++++++++++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 ports/yoga/add-project-declaration.patch diff --git a/ports/yoga/CONTROL b/ports/yoga/CONTROL index 14ed48f163..01f28ac171 100644 --- a/ports/yoga/CONTROL +++ b/ports/yoga/CONTROL @@ -1,4 +1,4 @@ Source: yoga -Version: 1.14.0 +Version: 1.14.0-1 Homepage: https://github.com/facebook/yoga Description: Yoga is a cross-platform layout engine which implements Flexbox diff --git a/ports/yoga/add-project-declaration.patch b/ports/yoga/add-project-declaration.patch new file mode 100644 index 0000000000..31a87ee1fa --- /dev/null +++ b/ports/yoga/add-project-declaration.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5a89ace..6b5836d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ + # + + cmake_minimum_required(VERSION 3.4.1) +- ++project(yogacore CXX) + set(CMAKE_VERBOSE_MAKEFILE on) + + file(GLOB yogacore_SRC yoga/*.cpp) diff --git a/ports/yoga/portfile.cmake b/ports/yoga/portfile.cmake index a98b92c7ad..c48e2c0b70 100644 --- a/ports/yoga/portfile.cmake +++ b/ports/yoga/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( REF 1.14.0 SHA512 c634cb9be08a4f4f478c50de9f26a2e1a18b9c6313b78665cd3a28047bd04e14aac2f06702c3bc9f55dba605177b787424a405c4043f052a94d311c76e38bef1 HEAD_REF master + PATCHES add-project-declaration.patch ) vcpkg_configure_cmake( @@ -22,11 +23,24 @@ vcpkg_build_cmake() vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/yoga DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h") + +set(YOGA_LIB_PREFFIX ) +if (NOT VCPKG_TARGET_IS_WINDOWS) + set(YOGA_LIB_PREFFIX lib) +endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/yogacore.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + set(YOGA_BINARY_PATH ) + if (VCPKG_TARGET_IS_WINDOWS) + set(YOGA_BINARY_PATH Release/) + endif() + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${YOGA_BINARY_PATH}${YOGA_LIB_PREFFIX}yogacore${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/yogacore.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + set(YOGA_BINARY_PATH ) + if (VCPKG_TARGET_IS_WINDOWS) + set(YOGA_BINARY_PATH Debug/) + endif() + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${YOGA_BINARY_PATH}${YOGA_LIB_PREFFIX}yogacore${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) endif() vcpkg_copy_pdbs()