From 50d5a1021623a89df035a1ef78557e0f1152648d Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 27 Apr 2022 13:51:30 -0400 Subject: Split out Artifact info (#2193) * #include an absolute path didn't work - because paths were taken to always be relative. * Compile to a dxil library. * Added CompileProduct. * Support handling of ModuleLibrary. * CacheBehavior -> Cache * Use CompileProduct for -r references. * CompileProduct -> Artifact. * Determining an artifact type on binding. * Determine binary linkability. * Added Artifact::exists. * Added ArtifactKeep. * Small fixes. * Small improvements to Artifact. * Add zip extension. * Fix some comments. * Fix multiple adding of PublicDecoration. Make public output export for DXIL/lib. Add checking for simpleDecorations such that only added once. * Use 'whole program' to identify library build. * Move slang-artifact into compiler-core. * Split out Keep free functions. * Artifact::Keep -> ArtifactKeep. * Handle libraries as artifacts. * Add -target dxil so test infrastructure knows it needs DXC. * Linking working in DXC. * Improve handling around emit for 'export'. * Add comment around Artifact name. * Render test working with linking. * Improvements around Artifact handling. * Add ArtifactPayloadInfo. * Small tidy up around artifact. * Split out code to get info about Artifacts into artifact-info.cpp/.h * Re-add slang-artifact.cpp * Readd artifact.cpp. --- source/slang/slang-options.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index b02c25549..10980f216 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -20,6 +20,7 @@ #include "../core/slang-hex-dump-util.h" #include "../compiler-core/slang-command-line-args.h" +#include "../compiler-core/slang-artifact-info.h" #include @@ -1402,7 +1403,7 @@ struct OptionsParser auto path = referenceModuleName.value; - auto desc = ArtifactDesc::fromPath(path.getUnownedSlice()); + auto desc = ArtifactInfoUtil::getDescFromPath(path.getUnownedSlice()); if (desc.kind == ArtifactKind::Unknown) { @@ -1411,12 +1412,12 @@ struct OptionsParser } // If it's a GPU binary, then we'll assume it's a library - if (desc.isGpuBinary()) + if (ArtifactInfoUtil::isGpuBinary(desc)) { desc.kind = ArtifactKind::Library; } - if (!desc.isBinaryLinkable()) + if (!ArtifactInfoUtil::isBinaryLinkable(desc)) { sink->diagnose(referenceModuleName.loc, Diagnostics::kindNotLinkable, Path::getPathExt(path)); return SLANG_FAIL; -- cgit v1.2.3