aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>2021-08-10 15:59:01 +0800
committerGitHub <noreply@github.com>2021-08-10 00:59:01 -0700
commit646aa7d8c0e62eb056aa1904b08664f663d7864e (patch)
tree07c2411d27d57b4d549f92cc9c2bab8fc31b1c67
parent3a37cc46f67334817a36cdf122dcbb58b1b1acea (diff)
downloadvcpkg-646aa7d8c0e62eb056aa1904b08664f663d7864e.tar.gz
vcpkg-646aa7d8c0e62eb056aa1904b08664f663d7864e.zip
[catch2] Support static build (#19396)
* [catch2] Update to 1.13.7 and support static build * Update version files * Revert the new version update changes * Update version files * Update versions/c-/catch2.json * Fix install path for lib and pkgconfig * Update versions/c-/catch2.json
-rw-r--r--ports/catch2/fix-install-path.patch22
-rw-r--r--ports/catch2/portfile.cmake16
-rw-r--r--ports/catch2/vcpkg.json14
-rw-r--r--versions/baseline.json2
-rw-r--r--versions/c-/catch2.json5
5 files changed, 51 insertions, 8 deletions
diff --git a/ports/catch2/fix-install-path.patch b/ports/catch2/fix-install-path.patch
new file mode 100644
index 000000000..c60e74b93
--- /dev/null
+++ b/ports/catch2/fix-install-path.patch
@@ -0,0 +1,22 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0370ea3..7cef01a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -146,7 +146,7 @@ if (NOT_SUBPROJECT)
+ EXPORT
+ Catch2Targets
+ DESTINATION
+- ${CMAKE_INSTALL_LIBDIR}
++ ${CMAKE_INSTALL_LIBDIR}/manual-link
+ )
+
+
+@@ -226,7 +226,7 @@ if (NOT_SUBPROJECT)
+
+ ## Provide some pkg-config integration
+ set(PKGCONFIG_INSTALL_DIR
+- "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
++ "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
+ CACHE PATH "Path where catch2.pc is installed"
+ )
+ configure_file(
diff --git a/ports/catch2/portfile.cmake b/ports/catch2/portfile.cmake
index 0b2c4c0e7..fcc6ab942 100644
--- a/ports/catch2/portfile.cmake
+++ b/ports/catch2/portfile.cmake
@@ -4,26 +4,32 @@ vcpkg_from_github(
REF 5c88067bd339465513af4aec606bd2292f1b594a # v2.13.6
SHA512 62ab120ef9cbbcf7320a96654bda60c766dbbcc0d9cbb2b0b36dd04e828315b627caf51e390dcea915efa266655fe0f28058b972c0d6e0e3e457c565d26e1fd3
HEAD_REF master
+ PATCHES fix-install-path.patch
)
-vcpkg_configure_cmake(
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
+
+vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
OPTIONS
-DBUILD_TESTING=OFF
-DCATCH_BUILD_EXAMPLES=OFF
+ -DCATCH_BUILD_STATIC_LIBRARY=${BUILD_STATIC}
)
-vcpkg_install_cmake()
+vcpkg_cmake_install()
file(RENAME "${CURRENT_PACKAGES_DIR}/share/Catch2" "${CURRENT_PACKAGES_DIR}/share/catch2_")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/catch2_" "${CURRENT_PACKAGES_DIR}/share/catch2")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/Catch2" "${CURRENT_PACKAGES_DIR}/debug/share/catch2_")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/catch2_" "${CURRENT_PACKAGES_DIR}/debug/share/catch2")
-vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Catch2)
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Catch2)
+
+vcpkg_fixup_pkgconfig()
-file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/include/catch2/catch.hpp")
message(FATAL_ERROR "Main includes have moved. Please update the forwarder.")
diff --git a/ports/catch2/vcpkg.json b/ports/catch2/vcpkg.json
index e0199bffa..0b81964b4 100644
--- a/ports/catch2/vcpkg.json
+++ b/ports/catch2/vcpkg.json
@@ -1,7 +1,17 @@
{
"name": "catch2",
"version-semver": "2.13.6",
- "port-version": 1,
+ "port-version": 2,
"description": "A modern, header-only test framework for unit testing.",
- "homepage": "https://github.com/catchorg/Catch2"
+ "homepage": "https://github.com/catchorg/Catch2",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
}
diff --git a/versions/baseline.json b/versions/baseline.json
index 28a7a3eb0..b9977c279 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -1154,7 +1154,7 @@
},
"catch2": {
"baseline": "2.13.6",
- "port-version": 1
+ "port-version": 2
},
"cccapstone": {
"baseline": "9b4128ee1153e78288a1b5433e2c06a0d47a4c4e-1",
diff --git a/versions/c-/catch2.json b/versions/c-/catch2.json
index cca4c3a00..646d520aa 100644
--- a/versions/c-/catch2.json
+++ b/versions/c-/catch2.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "ef9387df5727b456d41890580ac51c03cae9bb25",
+ "version-semver": "2.13.6",
+ "port-version": 2
+ },
+ {
"git-tree": "bd73b1d5e8994fb0327c333cd77400577f05e31c",
"version-semver": "2.13.6",
"port-version": 1