Skip to content

Commit d7d5ab8

Browse files
committed
Add symbol visibility annotations to glslang-resource-limits library
Among other things, this allows using it as a DLL on Windows.
1 parent 708d560 commit d7d5ab8

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

glslang/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ set_target_properties(glslang-default-resource-limits PROPERTIES
227227
target_include_directories(glslang-default-resource-limits PUBLIC
228228
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
229229
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
230+
glslang_only_export_explicit_symbols(glslang-default-resource-limits)
230231

231232
################################################################################
232233
# source_groups

glslang/Public/ResourceLimits.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,21 @@
3838
#include <string>
3939

4040
#include "../Include/ResourceLimits.h"
41+
#include "../Include/visibility.h"
4142

4243
// Return pointer to user-writable Resource to pass through API in
4344
// future-proof way.
44-
extern TBuiltInResource* GetResources();
45+
GLSLANG_EXPORT extern TBuiltInResource* GetResources();
4546

4647
// These are the default resources for TBuiltInResources, used for both
4748
// - parsing this string for the case where the user didn't supply one,
4849
// - dumping out a template for user construction of a config file.
49-
extern const TBuiltInResource* GetDefaultResources();
50+
GLSLANG_EXPORT extern const TBuiltInResource* GetDefaultResources();
5051

5152
// Returns the DefaultTBuiltInResource as a human-readable string.
52-
std::string GetDefaultTBuiltInResourceString();
53+
GLSLANG_EXPORT std::string GetDefaultTBuiltInResourceString();
5354

5455
// Decodes the resource limits from |config| to |resources|.
55-
void DecodeResourceLimits(TBuiltInResource* resources, char* config);
56+
GLSLANG_EXPORT void DecodeResourceLimits(TBuiltInResource* resources, char* config);
5657

5758
#endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_

glslang/Public/resource_limits_c.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
#define _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_
3131

3232
#include "../Include/glslang_c_interface.h"
33+
#include "../Include/visibility.h"
3334

3435
#ifdef __cplusplus
3536
extern "C" {
3637
#endif
3738

3839
// Returns a struct that can be use to create custom resource values.
39-
glslang_resource_t* glslang_resource(void);
40+
GLSLANG_EXPORT glslang_resource_t* glslang_resource(void);
4041

4142
// These are the default resources for TBuiltInResources, used for both
4243
// - parsing this string for the case where the user didn't supply one,
4344
// - dumping out a template for user construction of a config file.
44-
const glslang_resource_t* glslang_default_resource(void);
45+
GLSLANG_EXPORT const glslang_resource_t* glslang_default_resource(void);
4546

4647
// Returns the DefaultTBuiltInResource as a human-readable string.
4748
// NOTE: User is responsible for freeing this string.
48-
const char* glslang_default_resource_string();
49+
GLSLANG_EXPORT const char* glslang_default_resource_string();
4950

5051
// Decodes the resource limits from |config| to |resources|.
51-
void glslang_decode_resource_limits(glslang_resource_t* resources, char* config);
52+
GLSLANG_EXPORT void glslang_decode_resource_limits(glslang_resource_t* resources, char* config);
5253

5354
#ifdef __cplusplus
5455
}

0 commit comments

Comments
 (0)