From 1ccadd2cb6db3ce5a00635f65db21e561eb7f705 Mon Sep 17 00:00:00 2001 From: vlj 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