summaryrefslogtreecommitdiffstats
path: root/premake5.lua
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-09-13 15:59:15 -0400
committerGitHub <noreply@github.com>2019-09-13 15:59:15 -0400
commitc2e5d2468ad6a38cdb8a067da0678302f6cc6066 (patch)
tree97c448d28e54068d84c422e9f172996b7a95f1ed /premake5.lua
parent0b6321b3f08c48e37e6b8256d420f05d9727fb5a (diff)
Refactor render-test to make cross platform (#1053)
* First pass of render-test refactor. * Make window construction a function that can choose an implementation. * Remove OpenGL as currently has windows dependency. * Disable Vulkan as Renderer impl has dependency on windows. * Pass Window in as parameter of 'update'. * Add win-window.cpp as was missing. * Fix warning on windows about signs during comparison.
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua64
1 files changed, 29 insertions, 35 deletions
diff --git a/premake5.lua b/premake5.lua
index 63f83b00e..a1e729113 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -501,42 +501,26 @@ toolSharedLibrary "slang-reflection-test"
-- TODO: Fix that requirement.
--
-if isTargetWindows then
- toolSharedLibrary "render-test"
- uuid "61F7EB00-7281-4BF3-9470-7C2EA92620C3"
-
- includedirs { ".", "external", "source", "tools/gfx" }
- links { "core", "slang", "gfx" }
-
- systemversion "10.0.14393.0"
-
- 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"
+toolSharedLibrary "render-test"
+ uuid "61F7EB00-7281-4BF3-9470-7C2EA92620C3"
includedirs { ".", "external", "source", "tools/gfx" }
links { "core", "slang", "gfx" }
+
+ removefiles { "tools/render-test/cpu-render-test-main.cpp" }
- addSourceDir("tools/render-test")
-
- removefiles { "tools/render-test/render-test-main.cpp" }
-
- if isTargetWindows then
+ if isTargetWindows then
+ addSourceDir "tools/render-test/windows"
+
+ systemversion "10.0.14393.0"
+
-- 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
+ postbuildcommands { '"$(SolutionDir)tools\\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/%{cfg.platform:lower()}/" "%{cfg.targetdir}/" "windows-%{cfg.platform:lower()}"'}
+ end
+
--
-- `gfx` is a utility library for doing GPU rendering
-- and compute, which is used by both our testing and exmaples.
@@ -561,15 +545,25 @@ tool "gfx"
-- 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}/"'}
+
+ addSourceDir "tools/gfx/vulkan"
+ addSourceDir "tools/gfx/open-gl"
+ addSourceDir "tools/gfx/d3d"
+ addSourceDir "tools/gfx/d3d11"
+ addSourceDir "tools/gfx/d3d12"
+
+ addSourceDir "tools/gfx/windows"
+
+ elseif targetDetail == "mingw" or targetDetail == "cygwin" then
+ -- Don't support any render techs...
+ elseif os.target() == "macosx" then
+ --addSourceDir "tools/gfx/open-gl"
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" }
+ -- Linux like
+ --addSourceDir "tools/gfx/vulkan"
+ --addSourceDir "tools/gfx/open-gl"
end
-
- -- Remove VK from OSX gfx build
- if os.target() == "macosx" then
- 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"}