Skip to content

Commit

Permalink
[poly2tri] Set policy CMP0063 to NEW (#27263)
Browse files Browse the repository at this point in the history
* 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.

* fixup! Set policy CMP0063 to NEW

* 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.
  • Loading branch information
kduske committed Oct 19, 2022
1 parent da21221 commit 6ee2fa9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ports/poly2tri/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
cmake_minimum_required(VERSION 3.0)

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")
Expand Down
4 changes: 2 additions & 2 deletions ports/poly2tri/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "poly2tri",
"version-string": "2020-07-21",
"port-version": 2,
"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",
"supports": "!uwp",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5806,7 +5806,7 @@
},
"poly2tri": {
"baseline": "2020-07-21",
"port-version": 2
"port-version": 3
},
"polyclipping": {
"baseline": "6.4.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/poly2tri.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6f490bcfed9bb8b55036006a4389bfa7e94c73ff",
"version-date": "2020-07-21",
"port-version": 3
},
{
"git-tree": "03cdd793a8f279b18df99f74bf4eef1e24ad5809",
"version-string": "2020-07-21",
Expand Down

0 comments on commit 6ee2fa9

Please sign in to comment.