Skip to content

Commit

Permalink
[freeglut] fix debug macro patch (#11527)
Browse files Browse the repository at this point in the history
* [freeglut] fix linking release dll to debug lib

This patch:
1. Increments version by -1 in the CONTROL file
2. Adds execution of fix-debug-macro.patch file in portfile.cmake
3. Add the fix-debug-macro.patch to the port directory

* [freeglut] update version to -1 

Update CONTROL file to reflect version 3.2.1-1 adding fix-debug-macro.patch

* [freeglut] update portfile.cmake

Update portfile.cmake to execute new fix-debug-macro.patch
Reference: #8315
This patch updates:
1.  the ./include/GL/freeglut_std.h
     - line 73 and 91
       - from ifdef NDEBUG
       - to if defined(NDEBUG) || !defined(_DEBUG)
2. the ./src/blackberry/fg_main_blackberry.c
    - line 34
       - from ifdef NDEBUG
       - to if defined(NDEBUG) || !defined(_DEBUG)

* Update portfile.cmake

* Update ports/freeglut/portfile.cmake

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
  • Loading branch information
Time-Bandit and JackBoosY committed May 27, 2020
1 parent ec4846c commit 7bfd3e4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ports/freeglut/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: freeglut
Version: 3.2.1
Version: 3.2.1-1
Homepage: https://sourceforge.net/projects/freeglut/
Description: Open source implementation of GLUT with source and binary backwards compatibility.
35 changes: 35 additions & 0 deletions ports/freeglut/fix-debug-macro.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/include/GL/freeglut_std.h b/include/GL/freeglut_std.h
index a658c7c..a5efb3b 100644
--- a/include/GL/freeglut_std.h
+++ b/include/GL/freeglut_std.h
@@ -70,7 +70,7 @@

/* Link with Win32 static freeglut lib */
# if FREEGLUT_LIB_PRAGMAS
-# ifdef NDEBUG
+# if defined(NDEBUG) || !defined(_DEBUG)
# pragma comment (lib, "freeglut_static.lib")
# else
# pragma comment (lib, "freeglut_staticd.lib")
@@ -88,7 +88,7 @@

/* Link with Win32 shared freeglut lib */
# if FREEGLUT_LIB_PRAGMAS
-# ifdef NDEBUG
+# if defined(NDEBUG) || !defined(_DEBUG)
# pragma comment (lib, "freeglut.lib")
# else
# pragma comment (lib, "freeglutd.lib")
diff --git a/src/blackberry/fg_main_blackberry.c b/src/blackberry/fg_main_blackberry.c
index a1b9cbb..a20c53d 100644
--- a/src/blackberry/fg_main_blackberry.c
+++ b/src/blackberry/fg_main_blackberry.c
@@ -31,7 +31,7 @@
#include "fg_internal.h"
#include "egl/fg_window_egl.h"

-#ifdef NDEBUG
+#if defined(NDEBUG) || !defined(_DEBUG)
#define LOGI(...)
#endif

1 change: 1 addition & 0 deletions ports/freeglut/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ vcpkg_extract_source_archive_ex(
use_targets_to_export_x11_dependency.patch
macOS_Xquartz.patch
gcc10.patch
fix-debug-macro.patch
)

if(NOT VCPKG_TARGET_IS_WINDOWS)
Expand Down

0 comments on commit 7bfd3e4

Please sign in to comment.