From 4337338ed2d9525b4638f32c6b91ef61b69e41cd Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 10 Dec 2020 14:04:29 -0500 Subject: Building with embedded stdlib (#1634) * #include an absolute path didn't work - because paths were taken to always be relative. * Move reflection to reflection-api. * Slight reorg to pull out potentially Slang internal functions from the reflection API impls. * Remove visual studio projects * Fix for slang-binaries copy. * Add the visual studio projects in build/visual-studio * Remove miniz project. * Differentiate the linePath from the filePath. * Improve comment in premake5.lua + to kick of CI. * Kick CI. * Use COM compile request for calls to functions inside api-less-slang. Add static-slang project. * Fix const typo issue. * Don't include 'core' link in 'api-less-slang' * Removed static-slang lib causes problems on linux with linking. Embed Slang stdlib Added StaticBlob Added dumpSourceBytes Use ConstArrayView for the archive. At startup allow loading of zip with stdlib. Made -save-stdlib -load-stdlib take a name Added '-save-stdlib-bin-source' to save out serialized stdlib as source. * Ability enable/disable stdlib embedding. * Fix problem with moduleDecl not having module pointer set when serialized in. * Set of debugdir for slang-test and examples. * Add slang-stdlib-api.cpp * Update slang filters for VS. * Try to use pic, and -mcmodel=medium * Some more efforts ot make premake work. * WIP premake5.lua from previously working version. * Remove api-less-slang project. * Disable dllexport on gcc/clang. * Embed via slangc-bootstrap. * Fix slang-profile. Always compiles without stdlib. * Use pic "On" * Remove slangc-bootstrap and embed-stdlib-generator if embedding not required. Make bootstrap run the generators. * Improve comments in premake5.lua. Kick off another CI build. * Remove generation of stdlib source from std-lib-serialize.slang --- source/slang/slang-compiler.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-compiler.h') diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h index 9e3550066..ab02a0c54 100755 --- a/source/slang/slang-compiler.h +++ b/source/slang/slang-compiler.h @@ -1196,6 +1196,9 @@ namespace Slang /// Given a target returns a downstream compiler the prelude should be taken from. SourceLanguage getDefaultSourceLanguageForDownstreamCompiler(PassThroughMode compiler); + /// Get the build tag string + const char* getBuildTagString(); + struct TypeCheckingCache; /// A context for loading and re-using code modules. @@ -2148,8 +2151,8 @@ namespace Slang SLANG_NO_THROW SlangResult SLANG_MCALL checkPassThroughSupport(SlangPassThrough passThrough) override; SLANG_NO_THROW SlangResult SLANG_MCALL compileStdLib() override; - SLANG_NO_THROW SlangResult SLANG_MCALL loadStdLib() override; - SLANG_NO_THROW SlangResult SLANG_MCALL saveStdLib() override; + SLANG_NO_THROW SlangResult SLANG_MCALL loadStdLib(const void* stdLib, size_t stdLibSizeInBytes) override; + SLANG_NO_THROW SlangResult SLANG_MCALL saveStdLib(ISlangBlob** outBlob) override; /// Get the default compiler for a language DownstreamCompiler* getDefaultDownstreamCompiler(SourceLanguage sourceLanguage); @@ -2247,7 +2250,7 @@ namespace Slang private: - SlangResult _readBuiltinModule(Scope* scope, String moduleName); + SlangResult _readBuiltinModule(ISlangFileSystem* fileSystem, Scope* scope, String moduleName); SlangResult _loadRequest(EndToEndCompileRequest* request, const void* data, size_t size); -- cgit v1.2.3