Skip to content

Commit

Permalink
[gts] fix build with clang-cl (#26184)
Browse files Browse the repository at this point in the history
* gts fix dllexport definitions.

* v db

* Revert trailing whitespace addition.

Co-authored-by: Billy O'Neal <bion@microsoft.com>
  • Loading branch information
Neumann-A and BillyONeal committed Aug 6, 2022
1 parent 778c58d commit 9b22b40
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
13 changes: 13 additions & 0 deletions ports/gts/fix-dllexport_2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/gts.h b/src/gts.h
index 1b76915..ae1d888 100644
--- a/src/gts.h
+++ b/src/gts.h
@@ -38,7 +38,7 @@ extern "C" {
* we prefix variable declarations so they can
* properly get exported in windows dlls.
*/
-#ifdef NATIVE_WIN32
+#if 1
# ifdef GTS_COMPILATION
# define GTS_C_VAR __declspec(dllexport)
# else /* not GTS_COMPILATION */
13 changes: 13 additions & 0 deletions ports/gts/fix_missing_extern.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/gts.h b/src/gts.h
index 1b7691531..1e87167bc 100644
--- a/src/gts.h
+++ b/src/gts.h
@@ -40,7 +40,7 @@ extern "C" {
*/
#if 1
# ifdef GTS_COMPILATION
-# define GTS_C_VAR __declspec(dllexport)
+# define GTS_C_VAR extern __declspec(dllexport)
# else /* not GTS_COMPILATION */
# define GTS_C_VAR extern __declspec(dllimport)
# endif /* not GTS_COMPILATION */
4 changes: 2 additions & 2 deletions ports/gts/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(patches fix-dllexport.patch)
else()
set(patches "")
elseif(VCPKG_TARGET_IS_WINDOWS)
set(patches fix-dllexport_2.patch fix_missing_extern.patch)
endif()

vcpkg_from_sourceforge(
Expand Down
2 changes: 1 addition & 1 deletion ports/gts/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gts",
"version": "0.7.6",
"port-version": 6,
"port-version": 7,
"description": "3D surfaces meshed with interconnected triangles",
"homepage": "http://gts.sourceforge.net/",
"supports": "!osx",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2750,7 +2750,7 @@
},
"gts": {
"baseline": "0.7.6",
"port-version": 6
"port-version": 7
},
"guetzli": {
"baseline": "2020-09-14",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gts.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1bce412085edcd46e3f358cca2c3bb1cffb25cfa",
"version": "0.7.6",
"port-version": 7
},
{
"git-tree": "fbe5bc5629f2ec46a083b4e861589cae5b559c5f",
"version": "0.7.6",
Expand Down

0 comments on commit 9b22b40

Please sign in to comment.