diff options
| author | Yong He <yonghe@outlook.com> | 2021-09-30 17:51:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-30 17:51:56 -0700 |
| commit | 122d701513e116856bd59c999221ce36a373d7db (patch) | |
| tree | 95c2358708246deeebd63f773a9446b59334efbf | |
| parent | aa8f7b899b7b562b3d3c6e25c3da41569505e70c (diff) | |
Fix GitHub release (#1956)
* Fix aarch64 release build config.
* Fix for WinAarch64 build.
* Update premake for embed-std-lib build on aarch64.
* `platform` fix for aarach64 build.
* Try revert back to use absolute output path for slang-stdlib-generated.h
* Fix
* fix
Co-authored-by: Yong He <yhe@nvidia.com>
| -rw-r--r-- | .github/workflows/release-windows.yml | 2 | ||||
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | premake5.lua | 22 | ||||
| -rw-r--r-- | source/compiler-core/windows/slang-win-visual-studio-util.cpp | 3 | ||||
| -rw-r--r-- | tools/gfx/open-gl/render-gl.cpp | 38 | ||||
| -rw-r--r-- | tools/platform/windows/win-window.cpp | 2 |
6 files changed, 48 insertions, 20 deletions
diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 684c8bde9..3b70947a0 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -27,7 +27,7 @@ jobs: - name: msbuild (x64 tools) if: ${{ matrix.platform == 'aarch64' }} run: - MSBuild.exe slang.sln -v:m -m -target:slang-cpp-extractor;slang-generate;slang-embed -property:Configuration=Release -property:Platform=x64 -property:WindowsTargetPlatformVersion=10.0.19041.0 + MSBuild.exe slang.sln -v:m -m -property:Configuration=Release -property:Platform=x64 -property:WindowsTargetPlatformVersion=10.0.19041.0 - name: msbuild run: MSBuild.exe slang.sln -v:m -m -property:Configuration=${{matrix.configuration}} -property:Platform=${{matrix.platform}} -property:WindowsTargetPlatformVersion=10.0.19041.0 diff --git a/.gitignore b/.gitignore index 0e40ee660..9df009a6d 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ prelude/*.h.cpp /docs/_site /docs/Gemfile.lock /docs/Gemfile +/source/slang/slang-stdlib-generated.h diff --git a/premake5.lua b/premake5.lua index 56094f0c1..32760d25e 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1184,6 +1184,7 @@ if enableEmbedStdLib then "source/slang/slang-stdlib-api.cpp", } + defines { "SLANG_DYNAMIC_EXPORT" } -- Only produce the embedded stdlib if that option is enabled local executableSuffix = getExecutableSuffix() @@ -1195,16 +1196,19 @@ if enableEmbedStdLib then local absOutputPath = absDirectory .. "/slang-stdlib-generated.h" -- I don't know why I need a filter, but without it nothing works (!) - filter "files:source/slang/slang-stdlib-api.cpp" - - -- Note! Has to be an absolute path else doesn't work(!) - buildoutputs { absOutputPath } - + filter("files:source/slang/slang-stdlib-api.cpp") + -- Note! Has to be an absolute path else doesn't work(!) + buildoutputs { absOutputPath } + local f = getWinArm64Filter(true) + table.insert(f, "files:source/slang/slang-stdlib-api.cpp") + filter(f) + buildinputs { '"' .. getWinArm64BuildDir(true) .. '/slangc-bootstrap"' .. executableSuffix } + buildcommands {'"' .. getWinArm64BuildDir(true) .. '/slangc-bootstrap" -archive-type riff-lz4 -save-stdlib-bin-source "%{file.directory}/slang-stdlib-generated.h"' } + f = getWinArm64Filter(false) + table.insert(f, "files:source/slang/slang-stdlib-api.cpp") + filter(f) buildinputs { "%{cfg.targetdir}/slangc-bootstrap" .. executableSuffix } - - local buildcmd = '"%{cfg.targetdir}/slangc-bootstrap" -archive-type riff-lz4 -save-stdlib-bin-source %{file.directory}/slang-stdlib-generated.h' - - buildcommands { buildcmd } + buildcommands { '"%{cfg.targetdir}/slangc-bootstrap" -archive-type riff-lz4 -save-stdlib-bin-source "%{file.directory}/slang-stdlib-generated.h"' } end diff --git a/source/compiler-core/windows/slang-win-visual-studio-util.cpp b/source/compiler-core/windows/slang-win-visual-studio-util.cpp index 0dc8ea764..dd9656c23 100644 --- a/source/compiler-core/windows/slang-win-visual-studio-util.cpp +++ b/source/compiler-core/windows/slang-win-visual-studio-util.cpp @@ -14,7 +14,8 @@ # undef NOMINMAX # include <Shlobj.h> - +#pragma comment(lib, "advapi32") +#pragma comment(lib, "Shell32") #endif // The method used to invoke VS was originally inspired by some ideas in diff --git a/tools/gfx/open-gl/render-gl.cpp b/tools/gfx/open-gl/render-gl.cpp index 776806a49..9ad24146d 100644 --- a/tools/gfx/open-gl/render-gl.cpp +++ b/tools/gfx/open-gl/render-gl.cpp @@ -10,6 +10,14 @@ #include "core/slang-secure-crt.h" #include "external/stb/stb_image_write.h" +#if SLANG_WIN64 || SLANG_WIN64 +#define ENABLE_GL_IMPL 1 +#else +#define ENABLE_GL_IMPL 0 +#endif + +#if ENABLE_GL_IMPL + // TODO(tfoley): eventually we should be able to run these // tests on non-Windows targets to confirm that cross-compilation // at least *works* on those platforms... @@ -1633,14 +1641,6 @@ public: SLANG_COMPILE_TIME_ASSERT(SLANG_COUNT_OF(s_pixelFormatInfos) == int(GlPixelFormat::CountOf)); } -SlangResult SLANG_MCALL createGLDevice(const IDevice::Desc* desc, IDevice** outRenderer) -{ - RefPtr<GLDevice> result = new GLDevice(); - SLANG_RETURN_ON_FAIL(result->initialize(*desc)); - returnComPtr(outRenderer, result); - return SLANG_OK; -} - void GLDevice::debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message) { DebugMessageType msgType = DebugMessageType::Info; @@ -2894,4 +2894,24 @@ void GLDevice::bindRootShaderObject(IShaderObject* shaderObject) } } -} // renderer_test +SlangResult SLANG_MCALL createGLDevice(const IDevice::Desc* desc, IDevice** outRenderer) +{ + RefPtr<GLDevice> result = new GLDevice(); + SLANG_RETURN_ON_FAIL(result->initialize(*desc)); + returnComPtr(outRenderer, result); + return SLANG_OK; +} + +} // gfx + +#else + +namespace gfx +{ + SlangResult SLANG_MCALL createGLDevice(const IDevice::Desc* desc, IDevice** outRenderer) + { + *outRenderer = nullptr; + return SLANG_FAIL; + } +} +#endif diff --git a/tools/platform/windows/win-window.cpp b/tools/platform/windows/win-window.cpp index a0175a911..5e8c8524f 100644 --- a/tools/platform/windows/win-window.cpp +++ b/tools/platform/windows/win-window.cpp @@ -7,6 +7,8 @@ #include <windowsx.h> using namespace Slang; +#pragma comment(lib, "Gdi32") + namespace platform { |
