From a97eac202cec673a0f2e27e808cfdcdd29289c4e Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 19 Jul 2017 11:27:23 -0700 Subject: Build a dynamic library for Slang - Change the `slang` project from a static library to a dynamic one - Add some details around `slang.h` to make sure DLL export stuff is working - Make the `slangc` executable use the dynamic library - Rename the `glslang` sub-project to `slang-glslang` and move it into the main source hierarchy - This reflects the fact that it isn't a stand-alone tool, and isn't in any way a standard binary of glslang, but rather just an artifact of how Slang uses glslang --- source/slang/compiler.cpp | 4 ++-- source/slang/slang.vcxproj | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'source/slang') diff --git a/source/slang/compiler.cpp b/source/slang/compiler.cpp index 96fccced1..85e78e85b 100644 --- a/source/slang/compiler.cpp +++ b/source/slang/compiler.cpp @@ -14,7 +14,7 @@ #include "emit.h" // Utilities for pass-through modes -#include "../../tools/glslang/glslang.h" +#include "../slang-glslang/slang-glslang.h" #ifdef _WIN32 @@ -354,7 +354,7 @@ namespace Slang HMODULE getGLSLCompilerDLL() { // TODO(tfoley): let user specify version of glslang DLL to use. - static HMODULE glslCompiler = LoadLibraryA("glslang"); + static HMODULE glslCompiler = LoadLibraryA("slang-glslang"); // TODO(tfoley): handle case where we can't find it gracefully assert(glslCompiler); return glslCompiler; diff --git a/source/slang/slang.vcxproj b/source/slang/slang.vcxproj index 17fdea627..f67e7f5bb 100644 --- a/source/slang/slang.vcxproj +++ b/source/slang/slang.vcxproj @@ -27,26 +27,26 @@ - StaticLibrary + DynamicLibrary true v140 Unicode - StaticLibrary + DynamicLibrary true v140 Unicode - StaticLibrary + DynamicLibrary false v140 true Unicode - StaticLibrary + DynamicLibrary false v140 true @@ -90,7 +90,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + SLANG_DYNAMIC;SLANG_DYNAMIC_EXPORT;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) ../ MultiThreadedDebug false @@ -106,7 +106,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + SLANG_DYNAMIC;SLANG_DYNAMIC_EXPORT;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) ../ MultiThreadedDebug true @@ -128,7 +128,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + SLANG_DYNAMIC;SLANG_DYNAMIC_EXPORT;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) ../ MultiThreaded false @@ -148,7 +148,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + SLANG_DYNAMIC;SLANG_DYNAMIC_EXPORT;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) ../ MultiThreaded false @@ -218,6 +218,11 @@ + + + {f9be7957-8399-899e-0c49-e714fddd4b65} + + -- cgit v1.2.3