From 1ddf1f18d07ea5acb2fab0856422d5f7d918e798 Mon Sep 17 00:00:00 2001
From: Kristian Duske <kristian.duske@gmail.com>
Date: Sun, 16 Oct 2022 17:41:36 +0200
Subject: [PATCH 1/3] Set policy CMP0063 to NEW

This change enables CMake to set the symbol visibility of static
libraries. Since poly2tri is compiled as a static library, without this
change, it can lead to linker warnings about conflicting visibility
settings if it is itself linked into a dynamic library.
---
 ports/poly2tri/CMakeLists.txt | 4 ++++
 ports/poly2tri/vcpkg.json     | 2 +-
 versions/baseline.json        | 2 +-
 versions/p-/poly2tri.json     | 5 +++++
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ports/poly2tri/CMakeLists.txt b/ports/poly2tri/CMakeLists.txt
index d3878712afaaf9..673201bc9c7479 100644
--- a/ports/poly2tri/CMakeLists.txt
+++ b/ports/poly2tri/CMakeLists.txt
@@ -1,5 +1,9 @@
 cmake_minimum_required(VERSION 3.0)
 
+if(POLICY CMP0063)
+  cmake_policy(SET CMP0063 NEW)
+endif()
+
 project(poly2tri LANGUAGES C CXX)
 
 set(INSTALL_BIN_DIR      "bin"                     CACHE PATH "Path where exe and dll will be installed")
diff --git a/ports/poly2tri/vcpkg.json b/ports/poly2tri/vcpkg.json
index c8b963097d965a..da4f79b849eb03 100644
--- a/ports/poly2tri/vcpkg.json
+++ b/ports/poly2tri/vcpkg.json
@@ -1,7 +1,7 @@
 {
   "name": "poly2tri",
   "version-string": "2020-07-21",
-  "port-version": 2,
+  "port-version": 3,
   "description": "The Clipper library performs clipping and offsetting for both lines and polygons. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Polygons can be of any shape including self-intersecting polygons.",
   "homepage": "https://github.com/greenm01/poly2tri",
   "supports": "!uwp",
diff --git a/versions/baseline.json b/versions/baseline.json
index 04d0d6988b9ea5..dd525d70a6f637 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -5798,7 +5798,7 @@
     },
     "poly2tri": {
       "baseline": "2020-07-21",
-      "port-version": 2
+      "port-version": 3
     },
     "polyclipping": {
       "baseline": "6.4.2",
diff --git a/versions/p-/poly2tri.json b/versions/p-/poly2tri.json
index 070277383066af..920a3dd18cdc67 100644
--- a/versions/p-/poly2tri.json
+++ b/versions/p-/poly2tri.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "89645297df5f0af1fc040ac33ac243f42caa49fb",
+      "version-string": "2020-07-21",
+      "port-version": 3
+    },
     {
       "git-tree": "03cdd793a8f279b18df99f74bf4eef1e24ad5809",
       "version-string": "2020-07-21",

From 06c684f6f02458249b458e885d0d50b264b5ce16 Mon Sep 17 00:00:00 2001
From: Kristian Duske <kristian.duske@gmail.com>
Date: Mon, 17 Oct 2022 20:46:06 +0200
Subject: [PATCH 2/3] fixup! Set policy CMP0063 to NEW

---
 ports/poly2tri/CMakeLists.txt | 3 +++
 ports/poly2tri/vcpkg.json     | 2 +-
 versions/p-/poly2tri.json     | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ports/poly2tri/CMakeLists.txt b/ports/poly2tri/CMakeLists.txt
index 673201bc9c7479..0bb81850a094a8 100644
--- a/ports/poly2tri/CMakeLists.txt
+++ b/ports/poly2tri/CMakeLists.txt
@@ -4,6 +4,9 @@ if(POLICY CMP0063)
   cmake_policy(SET CMP0063 NEW)
 endif()
 
+set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
+
 project(poly2tri LANGUAGES C CXX)
 
 set(INSTALL_BIN_DIR      "bin"                     CACHE PATH "Path where exe and dll will be installed")
diff --git a/ports/poly2tri/vcpkg.json b/ports/poly2tri/vcpkg.json
index da4f79b849eb03..a00b5badd57aa6 100644
--- a/ports/poly2tri/vcpkg.json
+++ b/ports/poly2tri/vcpkg.json
@@ -1,6 +1,6 @@
 {
   "name": "poly2tri",
-  "version-string": "2020-07-21",
+  "version-date": "2020-07-21",
   "port-version": 3,
   "description": "The Clipper library performs clipping and offsetting for both lines and polygons. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Polygons can be of any shape including self-intersecting polygons.",
   "homepage": "https://github.com/greenm01/poly2tri",
diff --git a/versions/p-/poly2tri.json b/versions/p-/poly2tri.json
index 920a3dd18cdc67..7c41e7f05af3b7 100644
--- a/versions/p-/poly2tri.json
+++ b/versions/p-/poly2tri.json
@@ -1,8 +1,8 @@
 {
   "versions": [
     {
-      "git-tree": "89645297df5f0af1fc040ac33ac243f42caa49fb",
-      "version-string": "2020-07-21",
+      "git-tree": "6f490bcfed9bb8b55036006a4389bfa7e94c73ff",
+      "version-date": "2020-07-21",
       "port-version": 3
     },
     {

From d30d6c9de5172189a46c8579cc0928762376f154 Mon Sep 17 00:00:00 2001
From: Kristian Duske <kristian.duske@gmail.com>
Date: Mon, 17 Oct 2022 20:50:47 +0200
Subject: [PATCH 3/3] amend! Set policy CMP0063 to NEW

Set default symbol visibility to hidden

Policy CMP0063 enables CMake to set the symbol visibility of static
libraries. Since poly2tri is compiled as a static library, without this
change, the default symbol visibility cannot be set, leading to linker
warnings about conflicting visibility settings if poly2tri is itself
linked into a dynamic library.