diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/tinyxml2 | |
Diffstat (limited to 'vcpkg/ports/tinyxml2')
4 files changed, 114 insertions, 0 deletions
diff --git a/vcpkg/ports/tinyxml2/0001-fix-do-not-force-export-the-symbols-when-building-st.patch b/vcpkg/ports/tinyxml2/0001-fix-do-not-force-export-the-symbols-when-building-st.patch new file mode 100644 index 0000000..ef334ec --- /dev/null +++ b/vcpkg/ports/tinyxml2/0001-fix-do-not-force-export-the-symbols-when-building-st.patch @@ -0,0 +1,45 @@ +From a512d312db5604efe803a6fe088e7d582e04533f Mon Sep 17 00:00:00 2001 +From: Amin Yahyaabadi <aminyahyaabadi74@gmail.com> +Date: Wed, 26 Oct 2022 18:21:29 -0700 +Subject: [PATCH] fix: do not force export the symbols when building statically + +--- + CMakeLists.txt | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8802fb8..87cda90 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,8 +16,10 @@ endif () + ## Main library build
+ ##
+
+-set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+-set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
++if (BUILD_SHARED_LIBS)
++ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
++ set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
++endif()
+
+ add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
+ add_library(tinyxml2::tinyxml2 ALIAS tinyxml2)
+@@ -36,11 +38,14 @@ target_compile_definitions( + set_target_properties(
+ tinyxml2
+ PROPERTIES
+- DEFINE_SYMBOL "TINYXML2_EXPORT"
+ VERSION "${tinyxml2_VERSION}"
+ SOVERSION "${tinyxml2_VERSION_MAJOR}"
+ )
+
++if(BUILD_SHARED_LIBS)
++ target_compile_definitions(tinyxml2 PRIVATE "TINYXML2_EXPORT")
++endif()
++
+ if (tinyxml2_BUILD_TESTING)
+ add_executable(xmltest xmltest.cpp)
+ target_link_libraries(xmltest PRIVATE tinyxml2::tinyxml2)
+-- +2.37.3.windows.1 + diff --git a/vcpkg/ports/tinyxml2/0002-fix-check-for-TINYXML2_EXPORT-on-non-windows.patch b/vcpkg/ports/tinyxml2/0002-fix-check-for-TINYXML2_EXPORT-on-non-windows.patch new file mode 100644 index 0000000..7f2f750 --- /dev/null +++ b/vcpkg/ports/tinyxml2/0002-fix-check-for-TINYXML2_EXPORT-on-non-windows.patch @@ -0,0 +1,25 @@ +From 4beabf9fe05a049577e3923327804851d6a05f24 Mon Sep 17 00:00:00 2001 +From: Amin Yahyaabadi <aminyahyaabadi74@gmail.com> +Date: Thu, 27 Oct 2022 19:06:52 -0700 +Subject: [PATCH] fix: check for TINYXML2_EXPORT on non windows + +--- + tinyxml2.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tinyxml2.h b/tinyxml2.h +index cfb1053..5a36901 100755 +--- a/tinyxml2.h ++++ b/tinyxml2.h +@@ -72,7 +72,7 @@ distribution. + # else
+ # define TINYXML2_LIB
+ # endif
+-#elif __GNUC__ >= 4
++#elif defined(TINYXML2_EXPORT) && __GNUC__ >= 4
+ # define TINYXML2_LIB __attribute__((visibility("default")))
+ #else
+ # define TINYXML2_LIB
+-- +2.37.3.windows.1 + diff --git a/vcpkg/ports/tinyxml2/portfile.cmake b/vcpkg/ports/tinyxml2/portfile.cmake new file mode 100644 index 0000000..debc19c --- /dev/null +++ b/vcpkg/ports/tinyxml2/portfile.cmake @@ -0,0 +1,27 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO leethomason/tinyxml2 + REF "${VERSION}" + SHA512 8a6ddd48c96bc4287437d5b5ca62c131c4416c57310b664c9088ca9c1ac9f4d43d16c1bad03f82dc5588d9486752f510d631609a3930f1d4243f12184ad1c5f9 + HEAD_REF master + PATCHES + 0001-fix-do-not-force-export-the-symbols-when-building-st.patch + 0002-fix-check-for-TINYXML2_EXPORT-on-non-windows.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -Dtinyxml2_BUILD_TESTING=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/tinyxml2) +vcpkg_fixup_pkgconfig() + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/tinyxml2/vcpkg.json b/vcpkg/ports/tinyxml2/vcpkg.json new file mode 100644 index 0000000..13c121c --- /dev/null +++ b/vcpkg/ports/tinyxml2/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "tinyxml2", + "version-semver": "11.0.0", + "description": "A simple, small, efficient, C++ XML parser", + "homepage": "https://github.com/leethomason/tinyxml2", + "license": "Zlib", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |