summaryrefslogtreecommitdiffstats
path: root/premake5.lua
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-09-09 13:54:31 -0400
committerGitHub <noreply@github.com>2019-09-09 13:54:31 -0400
commit047daae9300c8a94d28383cf992ce00e3ad2da1e (patch)
tree520025463f6493b31d859a812af8a1384a23f715 /premake5.lua
parent4fc07614d6407e49a0c34e7483d410153c0b269a (diff)
CPU compute testing on non windows targets (#1045)
* WIP: Refactor of CPUCompute and stand alone cpu-render-test * Fix compilation on CygWin. * Make CPU compute tests run on non windows targets. * Check that C/C++ compiler is available for CPU compute. * Fix some tabbing issues. * Add -fPIC on gfx * Use dxcompiler_47.dll from slang-binaries on windows. * make https for git module slang-binaries * Fix comment in premake5.lua around d3dcompiler_47.dll * Add resources to the CPUComputeUtil::Context to keep in scope. * Fixes problem compiling on cygwin where dx12 is included in build of gfx lib.
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua37
1 files changed, 31 insertions, 6 deletions
diff --git a/premake5.lua b/premake5.lua
index 1f75b50c0..63f83b00e 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -510,25 +510,45 @@ if isTargetWindows then
systemversion "10.0.14393.0"
- -- For Windows targets, we want to copy d3dcompiler_47.dll,
+ removefiles { "tools/render-test/cpu-render-test-main.cpp" }
+
+ -- For Windows targets, we want to copy
-- dxcompiler.dll, and dxil.dll from the Windows SDK redistributable
-- directory into the output directory.
+ -- d3dcompiler_47.dll is copied from the external/slang-binaries submodule.
postbuildcommands { '"$(SolutionDir)tools\\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/%{cfg.platform:lower()}/" "%{cfg.targetdir}/" "windows-%{cfg.platform:lower()}"'}
end
-
+
+toolSharedLibrary "cpu-render-test"
+ uuid "5701695E-7324-4B4D-977A-8D56C2A041B1"
+
+ includedirs { ".", "external", "source", "tools/gfx" }
+ links { "core", "slang", "gfx" }
+
+ addSourceDir("tools/render-test")
+
+ removefiles { "tools/render-test/render-test-main.cpp" }
+
+ if isTargetWindows then
+ -- For Windows targets, we want to copy
+ -- dxcompiler.dll, and dxil.dll from the Windows SDK redistributable
+ -- directory into the output directory.
+ -- d3dcompiler_47.dll is copied from the external/slang-binaries submodule.
+ postbuildcommands { '"$(SolutionDir)tools\\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/%{cfg.platform:lower()}/" "%{cfg.targetdir}/"'}
+ end
--
-- `gfx` is a utility library for doing GPU rendering
-- and compute, which is used by both our testing and exmaples.
-- It depends on teh `core` library, so we need to declare that:
--
-tool "gfx"
+tool "gfx"
uuid "222F7498-B40C-4F3F-A704-DDEB91A4484A"
-- Unlike most of the code under `tools/`, this is a library
-- rather than a stand-alone executable.
kind "StaticLib"
-
+
includedirs { ".", "external", "source", "external/imgui" }
-- To special case that we may be building using cygwin on windows. If 'true windows' we build for dx12/vk and run the script
@@ -536,9 +556,10 @@ tool "gfx"
if isTargetWindows then
systemversion "10.0.14393.0"
- -- For Windows targets, we want to copy d3dcompiler_47.dll,
+ -- For Windows targets, we want to copy
-- dxcompiler.dll, and dxil.dll from the Windows SDK redistributable
- -- directory into the output directory.
+ -- directory into the output directory.
+ -- d3dcompiler_47.dll is copied from the external/slang-binaries submodule.
postbuildcommands { '"$(SolutionDir)tools\\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/%{cfg.platform:lower()}/" "%{cfg.targetdir}/"'}
else
removefiles { "tools/gfx/circular-resource-heap-d3d12.cpp", "tools/gfx/d3d-util.cpp", "tools/gfx/descriptor-heap-d3d12.cpp", "tools/gfx/render-d3d11.cpp", "tools/gfx/render-d3d12.cpp", "tools/gfx/render-gl.cpp", "tools/gfx/resource-d3d12.cpp", "tools/gfx/render-vk.cpp", "tools/gfx/vk-swap-chain.cpp", "tools/gfx/window.cpp" }
@@ -549,6 +570,10 @@ tool "gfx"
removefiles { "tools/gfx/render-vk.cpp", "tools/gfx/vk-device-queue.cpp", "tools/gfx/vk-api.cpp", "tools/gfx/vk-module.cpp", "tools/gfx/vk-swap-chain.cpp", "tools/gfx/vk-util.cpp" }
end
+ filter { "system:linux" }
+ -- might be able to do pic(true)
+ buildoptions{"-fPIC"}
+
--
-- The `slangc` command-line application is just a very thin wrapper
-- around the Slang dynamic library, so its build is extermely simple.