aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2020-05-29 04:12:23 +0800
committerGitHub <noreply@github.com>2020-05-28 13:12:23 -0700
commit091e190117613ffc4917f83c6e13ca1095e9cb2f (patch)
treeacc2454c3befbaded57c5d2f8d38481124f6bf24
parent43208001aa678448e56714dc5132e7ece82e5af6 (diff)
downloadvcpkg-091e190117613ffc4917f83c6e13ca1095e9cb2f.tar.gz
vcpkg-091e190117613ffc4917f83c6e13ca1095e9cb2f.zip
[cpputest] Move library to manual-link (#11585)
* [cpputest] Move library to manual-link * [cpputest] Replace move patch to codes
-rw-r--r--ports/cpputest/CONTROL2
-rw-r--r--ports/cpputest/portfile.cmake31
2 files changed, 29 insertions, 4 deletions
diff --git a/ports/cpputest/CONTROL b/ports/cpputest/CONTROL
index cecf6e221..7d0840829 100644
--- a/ports/cpputest/CONTROL
+++ b/ports/cpputest/CONTROL
@@ -1,4 +1,4 @@
Source: cpputest
-Version: 2019-9-16
+Version: 2019-9-16-1
Homepage: https://github.com/cpputest/cpputest
Description: CppUTest unit testing and mocking framework for C/C++. \ No newline at end of file
diff --git a/ports/cpputest/portfile.cmake b/ports/cpputest/portfile.cmake
index 904f1d0b1..4745ea469 100644
--- a/ports/cpputest/portfile.cmake
+++ b/ports/cpputest/portfile.cmake
@@ -1,5 +1,3 @@
-include(vcpkg_common_functions)
-
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
@@ -8,7 +6,8 @@ vcpkg_from_github(
REF 4699da9942a1bdcc33e2a8c8a48e863b0f18188e
SHA512 6f588691f1b4092b3be8167ab09f3a4a64c34715ac9397210724121d161024a43b12a88198b02b0cc8da7d72406670daaf375bb64cc4cf92c8bd2479e7a881bc
HEAD_REF master
- PATCHES fix-arm-build-error.patch
+ PATCHES
+ fix-arm-build-error.patch
)
vcpkg_configure_cmake(
@@ -27,6 +26,32 @@ if (EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/CppUTest)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/CppUTest)
endif()
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
+ file(GLOB CPPUTEST_LIBS ${CURRENT_PACKAGES_DIR}/lib/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX})
+ file(COPY ${CPPUTEST_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link)
+ file(REMOVE ${CPPUTEST_LIBS})
+
+ file(READ ${CURRENT_PACKAGES_DIR}/share/CppUTest/CppUTestTargets-release.cmake RELEASE_CONFIG)
+ # Replace CppUTestExt first
+ string(REPLACE "\${_IMPORT_PREFIX}/lib/"
+ "\${_IMPORT_PREFIX}/lib/manual-link/" RELEASE_CONFIG "${RELEASE_CONFIG}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/share/CppUTest/CppUTestTargets-release.cmake "${RELEASE_CONFIG}")
+endif()
+
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
+ file(GLOB CPPUTEST_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX})
+ file(COPY ${CPPUTEST_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
+ file(REMOVE ${CPPUTEST_LIBS})
+
+ file(READ ${CURRENT_PACKAGES_DIR}/share/CppUTest/CppUTestTargets-debug.cmake DEBUG_CONFIG)
+ # Replace CppUTestExt first
+ string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/"
+ "\${_IMPORT_PREFIX}/debug/lib/manual-link/" DEBUG_CONFIG "${DEBUG_CONFIG}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/share/CppUTest/CppUTestTargets-debug.cmake "${DEBUG_CONFIG}")
+endif()
+
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)