From 1296c7bb55b14db24308f31cacdda7f7a71fc937 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sun, 17 Jan 2021 22:00:49 -0800 Subject: Make `gfx` compile to a DLL. (#1660) * Make `gfx` compile to a DLL. * Fix cuda * Fix cuda build * Bug gl screen capture bug. --- .../cpu-hello-world/cpu-hello-world.vcxproj | 3 + build/visual-studio/gfx-util/gfx-util.vcxproj | 169 +++++++++++++++++++++ .../gfx-util/gfx-util.vcxproj.filters | 21 +++ build/visual-studio/gfx/gfx.vcxproj | 46 +++--- build/visual-studio/gfx/gfx.vcxproj.filters | 18 --- .../gpu-printing/gpu-printing.vcxproj | 3 + .../visual-studio/hello-world/hello-world.vcxproj | 3 + .../heterogeneous-hello-world.vcxproj | 3 + .../model-viewer/model-viewer.vcxproj | 3 + .../render-test-tool/render-test-tool.vcxproj | 5 + .../render-test-tool.vcxproj.filters | 6 + build/visual-studio/shader-toy/shader-toy.vcxproj | 3 + 12 files changed, 247 insertions(+), 36 deletions(-) create mode 100644 build/visual-studio/gfx-util/gfx-util.vcxproj create mode 100644 build/visual-studio/gfx-util/gfx-util.vcxproj.filters (limited to 'build/visual-studio') diff --git a/build/visual-studio/cpu-hello-world/cpu-hello-world.vcxproj b/build/visual-studio/cpu-hello-world/cpu-hello-world.vcxproj index 9d4c819cf..2fb93b42c 100644 --- a/build/visual-studio/cpu-hello-world/cpu-hello-world.vcxproj +++ b/build/visual-studio/cpu-hello-world/cpu-hello-world.vcxproj @@ -177,6 +177,9 @@ {222F7498-B40C-4F3F-A704-DDEB91A4484A} + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + {3565FE5E-4FA3-11EB-AE93-0242AC130002} diff --git a/build/visual-studio/gfx-util/gfx-util.vcxproj b/build/visual-studio/gfx-util/gfx-util.vcxproj new file mode 100644 index 000000000..d75105524 --- /dev/null +++ b/build/visual-studio/gfx-util/gfx-util.vcxproj @@ -0,0 +1,169 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + true + Win32Proj + gfx-util + + + + StaticLibrary + true + Unicode + v140 + + + StaticLibrary + true + Unicode + v140 + + + StaticLibrary + false + Unicode + v140 + + + StaticLibrary + false + Unicode + v140 + + + + + + + + + + + + + + + + + + + ..\..\..\bin\windows-x86\debug\ + ..\..\..\intermediate\windows-x86\debug\gfx-util\ + gfx-util + .lib + + + ..\..\..\bin\windows-x64\debug\ + ..\..\..\intermediate\windows-x64\debug\gfx-util\ + gfx-util + .lib + + + ..\..\..\bin\windows-x86\release\ + ..\..\..\intermediate\windows-x86\release\gfx-util\ + gfx-util + .lib + + + ..\..\..\bin\windows-x64\release\ + ..\..\..\intermediate\windows-x64\release\gfx-util\ + gfx-util + .lib + + + + NotUsing + Level3 + _DEBUG;%(PreprocessorDefinitions) + ..\..\..;..\..\..\source;%(AdditionalIncludeDirectories) + EditAndContinue + Disabled + MultiThreadedDebug + + + Windows + true + + + + + NotUsing + Level3 + _DEBUG;%(PreprocessorDefinitions) + ..\..\..;..\..\..\source;%(AdditionalIncludeDirectories) + EditAndContinue + Disabled + MultiThreadedDebug + + + Windows + true + + + + + NotUsing + Level3 + NDEBUG;%(PreprocessorDefinitions) + ..\..\..;..\..\..\source;%(AdditionalIncludeDirectories) + Full + true + true + false + true + MultiThreaded + + + Windows + true + true + + + + + NotUsing + Level3 + NDEBUG;%(PreprocessorDefinitions) + ..\..\..;..\..\..\source;%(AdditionalIncludeDirectories) + Full + true + true + false + true + MultiThreaded + + + Windows + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/build/visual-studio/gfx-util/gfx-util.vcxproj.filters b/build/visual-studio/gfx-util/gfx-util.vcxproj.filters new file mode 100644 index 000000000..23e932b8c --- /dev/null +++ b/build/visual-studio/gfx-util/gfx-util.vcxproj.filters @@ -0,0 +1,21 @@ + + + + + {21EB8090-0D4E-1035-B6D3-48EBA215DCB7} + + + {E9C7FDCE-D52A-8D73-7EB0-C5296AF258F6} + + + + + Header Files + + + + + Source Files + + + \ No newline at end of file diff --git a/build/visual-studio/gfx/gfx.vcxproj b/build/visual-studio/gfx/gfx.vcxproj index 789440fb7..0ed5ed233 100644 --- a/build/visual-studio/gfx/gfx.vcxproj +++ b/build/visual-studio/gfx/gfx.vcxproj @@ -27,25 +27,25 @@ - StaticLibrary + DynamicLibrary true Unicode v140 - StaticLibrary + DynamicLibrary true Unicode v140 - StaticLibrary + DynamicLibrary false Unicode v140 - StaticLibrary + DynamicLibrary false Unicode v140 @@ -67,34 +67,38 @@ + true ..\..\..\bin\windows-x86\debug\ ..\..\..\intermediate\windows-x86\debug\gfx\ gfx - .lib + .dll + true ..\..\..\bin\windows-x64\debug\ ..\..\..\intermediate\windows-x64\debug\gfx\ gfx - .lib + .dll + false ..\..\..\bin\windows-x86\release\ ..\..\..\intermediate\windows-x86\release\gfx\ gfx - .lib + .dll + false ..\..\..\bin\windows-x64\release\ ..\..\..\intermediate\windows-x64\release\gfx\ gfx - .lib + .dll NotUsing Level3 - _DEBUG;%(PreprocessorDefinitions) + _DEBUG;SLANG_GFX_DYNAMIC;SLANG_GFX_DYNAMIC_EXPORT;%(PreprocessorDefinitions) ..\..\..;..\..\..\external;..\..\..\source;%(AdditionalIncludeDirectories) EditAndContinue Disabled @@ -103,6 +107,7 @@ Windows true + ..\..\..\bin\windows-x86\debug\gfx.lib "$(SolutionDir)tools\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/x86/" "../../../bin/windows-x86/debug/" @@ -112,7 +117,7 @@ NotUsing Level3 - _DEBUG;%(PreprocessorDefinitions) + _DEBUG;SLANG_GFX_DYNAMIC;SLANG_GFX_DYNAMIC_EXPORT;%(PreprocessorDefinitions) ..\..\..;..\..\..\external;..\..\..\source;%(AdditionalIncludeDirectories) EditAndContinue Disabled @@ -121,6 +126,7 @@ Windows true + ..\..\..\bin\windows-x64\debug\gfx.lib "$(SolutionDir)tools\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/x64/" "../../../bin/windows-x64/debug/" @@ -130,7 +136,7 @@ NotUsing Level3 - NDEBUG;%(PreprocessorDefinitions) + NDEBUG;SLANG_GFX_DYNAMIC;SLANG_GFX_DYNAMIC_EXPORT;%(PreprocessorDefinitions) ..\..\..;..\..\..\external;..\..\..\source;%(AdditionalIncludeDirectories) Full true @@ -143,6 +149,7 @@ Windows true true + ..\..\..\bin\windows-x86\release\gfx.lib "$(SolutionDir)tools\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/x86/" "../../../bin/windows-x86/release/" @@ -152,7 +159,7 @@ NotUsing Level3 - NDEBUG;%(PreprocessorDefinitions) + NDEBUG;SLANG_GFX_DYNAMIC;SLANG_GFX_DYNAMIC_EXPORT;%(PreprocessorDefinitions) ..\..\..;..\..\..\external;..\..\..\source;%(AdditionalIncludeDirectories) Full true @@ -165,6 +172,7 @@ Windows true true + ..\..\..\bin\windows-x64\release\gfx.lib "$(SolutionDir)tools\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/x64/" "../../../bin/windows-x64/release/" @@ -185,9 +193,6 @@ - - - @@ -209,9 +214,6 @@ - - - @@ -219,6 +221,14 @@ + + + {F9BE7957-8399-899E-0C49-E714FDDD4B65} + + + {DB00DA62-0533-4AFD-B59F-A67D5B3A0808} + + diff --git a/build/visual-studio/gfx/gfx.vcxproj.filters b/build/visual-studio/gfx/gfx.vcxproj.filters index 90caef2f9..97658fffa 100644 --- a/build/visual-studio/gfx/gfx.vcxproj.filters +++ b/build/visual-studio/gfx/gfx.vcxproj.filters @@ -51,15 +51,6 @@ Header Files - - Header Files - - - Header Files - - - Header Files - Header Files @@ -119,15 +110,6 @@ Source Files - - Source Files - - - Source Files - - - Source Files - Source Files diff --git a/build/visual-studio/gpu-printing/gpu-printing.vcxproj b/build/visual-studio/gpu-printing/gpu-printing.vcxproj index 9b8834666..f7b783f39 100644 --- a/build/visual-studio/gpu-printing/gpu-printing.vcxproj +++ b/build/visual-studio/gpu-printing/gpu-printing.vcxproj @@ -183,6 +183,9 @@ {222F7498-B40C-4F3F-A704-DDEB91A4484A} + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + {3565FE5E-4FA3-11EB-AE93-0242AC130002} diff --git a/build/visual-studio/hello-world/hello-world.vcxproj b/build/visual-studio/hello-world/hello-world.vcxproj index 60dde7007..a7a51362b 100644 --- a/build/visual-studio/hello-world/hello-world.vcxproj +++ b/build/visual-studio/hello-world/hello-world.vcxproj @@ -177,6 +177,9 @@ {222F7498-B40C-4F3F-A704-DDEB91A4484A} + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + {3565FE5E-4FA3-11EB-AE93-0242AC130002} diff --git a/build/visual-studio/heterogeneous-hello-world/heterogeneous-hello-world.vcxproj b/build/visual-studio/heterogeneous-hello-world/heterogeneous-hello-world.vcxproj index 74bd9213b..78bdb1f3e 100644 --- a/build/visual-studio/heterogeneous-hello-world/heterogeneous-hello-world.vcxproj +++ b/build/visual-studio/heterogeneous-hello-world/heterogeneous-hello-world.vcxproj @@ -178,6 +178,9 @@ {222F7498-B40C-4F3F-A704-DDEB91A4484A} + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + {3565FE5E-4FA3-11EB-AE93-0242AC130002} diff --git a/build/visual-studio/model-viewer/model-viewer.vcxproj b/build/visual-studio/model-viewer/model-viewer.vcxproj index b7523fe4f..8c8044d48 100644 --- a/build/visual-studio/model-viewer/model-viewer.vcxproj +++ b/build/visual-studio/model-viewer/model-viewer.vcxproj @@ -177,6 +177,9 @@ {222F7498-B40C-4F3F-A704-DDEB91A4484A} + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + {3565FE5E-4FA3-11EB-AE93-0242AC130002} diff --git a/build/visual-studio/render-test-tool/render-test-tool.vcxproj b/build/visual-studio/render-test-tool/render-test-tool.vcxproj index b9841e122..e74392972 100644 --- a/build/visual-studio/render-test-tool/render-test-tool.vcxproj +++ b/build/visual-studio/render-test-tool/render-test-tool.vcxproj @@ -186,6 +186,7 @@ + @@ -197,6 +198,7 @@ + @@ -210,6 +212,9 @@ {222F7498-B40C-4F3F-A704-DDEB91A4484A} + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + {3565FE5E-4FA3-11EB-AE93-0242AC130002} diff --git a/build/visual-studio/render-test-tool/render-test-tool.vcxproj.filters b/build/visual-studio/render-test-tool/render-test-tool.vcxproj.filters index 1c0d82cdd..5223edb08 100644 --- a/build/visual-studio/render-test-tool/render-test-tool.vcxproj.filters +++ b/build/visual-studio/render-test-tool/render-test-tool.vcxproj.filters @@ -30,6 +30,9 @@ Header Files + + Header Files + Header Files @@ -59,6 +62,9 @@ Source Files + + Source Files + Source Files diff --git a/build/visual-studio/shader-toy/shader-toy.vcxproj b/build/visual-studio/shader-toy/shader-toy.vcxproj index 5c540113b..9fd7014a3 100644 --- a/build/visual-studio/shader-toy/shader-toy.vcxproj +++ b/build/visual-studio/shader-toy/shader-toy.vcxproj @@ -178,6 +178,9 @@ {222F7498-B40C-4F3F-A704-DDEB91A4484A} + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + {3565FE5E-4FA3-11EB-AE93-0242AC130002} -- cgit v1.2.3