aboutsummaryrefslogtreecommitdiff
path: root/ports/libsquish/fix-export-symbols.patch
blob: febf2eb51425e4d28f82f3147d5a2d5c0f5b3bb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a36e574..a3ecdde 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,6 +75,13 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 
 ADD_LIBRARY(squish ${SQUISH_SRCS} ${SQUISH_HDRS})
 
+INCLUDE(GenerateExportHeader)
+GENERATE_EXPORT_HEADER(squish
+    EXPORT_FILE_NAME ${CMAKE_CURRENT_SOURCE_DIR}/squish_export.h
+    )
+
+list(APPEND SQUISH_HDRS "squish_export.h")
+
 SET_TARGET_PROPERTIES(
     squish PROPERTIES
     PUBLIC_HEADER "${SQUISH_HDRS}"
@@ -109,9 +116,12 @@ IF (BUILD_SQUISH_EXTRA)
     ENDIF (PNG_FOUND)
 ENDIF (BUILD_SQUISH_EXTRA)
 
+INCLUDE(GNUInstallDirs)
+
 INSTALL(
     TARGETS squish
-    LIBRARY DESTINATION lib
-    ARCHIVE DESTINATION lib
-    PUBLIC_HEADER DESTINATION include
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+    PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
     )
diff --git a/squish.h b/squish.h
index 14c9bb5..aaffbb2 100644
--- a/squish.h
+++ b/squish.h
@@ -26,6 +26,8 @@
 #ifndef SQUISH_H
 #define SQUISH_H
 
+#include "squish_export.h"
+
 //! All squish API functions live in this namespace.
 namespace squish {
 
@@ -176,7 +178,7 @@ inline void Compress( u8 const* rgba, void* block, int flags, float* metric = 0
     however, DXT1 will be used by default if none is specified. All other flags
     are ignored.
 */
-void Decompress( u8* rgba, void const* block, int flags );
+SQUISH_EXPORT void Decompress( u8* rgba, void const* block, int flags );
 
 // -----------------------------------------------------------------------------
 
@@ -194,7 +196,7 @@ void Decompress( u8* rgba, void const* block, int flags );
     function supports arbitrary size images by allowing the outer blocks to
     be only partially used.
 */
-int GetStorageRequirements( int width, int height, int flags );
+SQUISH_EXPORT int GetStorageRequirements( int width, int height, int flags );
 
 // -----------------------------------------------------------------------------
 
@@ -249,8 +251,8 @@ int GetStorageRequirements( int width, int height, int flags );
     Windows platform but for other platforms like MacOS X a different
     gamma value may be more suitable.
 */
-void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric = 0 );
-void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric = 0 );
+SQUISH_EXPORT void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric = 0 );
+SQUISH_EXPORT void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric = 0 );
 
 // -----------------------------------------------------------------------------
 
@@ -274,8 +276,8 @@ void CompressImage( u8 const* rgba, int width, int height, void* blocks, int fla
 
     Internally this function calls squish::Decompress for each block.
 */
-void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags );
-void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags );
+SQUISH_EXPORT void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags );
+SQUISH_EXPORT void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags );
 
 // -----------------------------------------------------------------------------
 
@@ -299,8 +301,8 @@ void DecompressImage( u8* rgba, int width, int height, void const* blocks, int f
 
     Internally this function calls squish::Decompress for each block.
 */
-void ComputeMSE(u8 const *rgba, int width, int height, int pitch, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
-void ComputeMSE(u8 const *rgba, int width, int height, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
+SQUISH_EXPORT void ComputeMSE(u8 const *rgba, int width, int height, int pitch, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
+SQUISH_EXPORT void ComputeMSE(u8 const *rgba, int width, int height, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
 
 // -----------------------------------------------------------------------------