aboutsummaryrefslogtreecommitdiff
path: root/ports/glslang/0001-Fix-export-symbol-for-Windows.patch
blob: 80ce58da48c10ff9595ceecad84ed1aafeba3bf6 (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
From 1ccadd2cb6db3ce5a00635f65db21e561eb7f705 Mon Sep 17 00:00:00 2001
From: vlj <vljn.ovi@gmail.com>
Date: Fri, 25 Nov 2016 17:12:35 +0100
Subject: [PATCH] Fix export symbol for Windows.

---
 StandAlone/CMakeLists.txt     |  1 +
 StandAlone/ResourceLimits.cpp |  3 +++
 StandAlone/ResourceLimits.h   | 10 ++++++++++
 3 files changed, 14 insertions(+)

diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt
index 231ba27..3aff02e 100644
--- a/StandAlone/CMakeLists.txt
+++ b/StandAlone/CMakeLists.txt
@@ -2,6 +2,7 @@ add_library(glslang-default-resource-limits
     ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp
 )
 set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
+set_property(TARGET glslang-default-resource-limits PROPERTY COMPILE_DEFINITIONS DLLEXPORT)
 
 target_include_directories(glslang-default-resource-limits
     PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/StandAlone/ResourceLimits.cpp b/StandAlone/ResourceLimits.cpp
index e22ec80..634d9c9 100644
--- a/StandAlone/ResourceLimits.cpp
+++ b/StandAlone/ResourceLimits.cpp
@@ -41,6 +41,7 @@
 
 namespace glslang {
 
+DLL_EXPORT
 const TBuiltInResource DefaultTBuiltInResource = {
     /* .MaxLights = */ 32,
     /* .MaxClipPlanes = */ 6,
@@ -137,6 +138,7 @@ const TBuiltInResource DefaultTBuiltInResource = {
         /* .generalConstantMatrixVectorIndexing = */ 1,
     }};
 
+DLL_EXPORT
 std::string GetDefaultTBuiltInResourceString()
 {
     std::ostringstream ostream;
@@ -239,6 +241,7 @@ std::string GetDefaultTBuiltInResourceString()
     return ostream.str();
 }
 
+DLL_EXPORT
 void DecodeResourceLimits(TBuiltInResource* resources, char* config)
 {
     static const char* delims = " \t\n\r";
diff --git a/StandAlone/ResourceLimits.h b/StandAlone/ResourceLimits.h
index 9c3eb3e..932a59f 100644
--- a/StandAlone/ResourceLimits.h
+++ b/StandAlone/ResourceLimits.h
@@ -39,17 +39,27 @@
 
 #include "glslang/Include/ResourceLimits.h"
 
+#ifdef DLLEXPORT
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+
 namespace glslang {
 
 // These are the default resources for TBuiltInResources, used for both
 //  - parsing this string for the case where the user didn't supply one,
 //  - dumping out a template for user construction of a config file.
+
+DLL_EXPORT
 extern const TBuiltInResource DefaultTBuiltInResource;
 
 // Returns the DefaultTBuiltInResource as a human-readable string.
+DLL_EXPORT
 std::string GetDefaultTBuiltInResourceString();
 
 // Decodes the resource limits from |config| to |resources|.
+DLL_EXPORT
 void DecodeResourceLimits(TBuiltInResource* resources, char* config);
 
 }  // end namespace glslang
-- 
2.10.2.windows.1