From ae222bf4fa131b8b86dd0662b32214eb161ace1a Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 2 Dec 2020 11:29:38 -0500 Subject: Zip FileSystem support (#1617) * #include an absolute path didn't work - because paths were taken to always be relative. * Add miniz * Fix for separator in CacheFileSystem. Add compression unit test for zip. * Put zip compression into core. * Remove delimiter stripping if simplifying a path - as stripping will fix delimiters. * ZipFileSystem WIP. * More ZipFileSystem working. * Added isEmpty. Fixed small bug is contains. * First pass support for mutability on zip. * Improvements to File::read/writeAllBytes * Can access and save archive - but has memory leaks. * Fix memory leak. * Some ZIP compression tests. * Fix memory leak on ScopedAllocation. Fix off by one bug on UIntSet * Bug fix in UIntSet * Fix remaining ZipFileSystem issues. Adde stand alone unit-test. * Turn tabs to spaces in slang-io.h * Renamed mode ReadWrite (instead of just Write) * Make miniz it's own project. * Fix windows warning on win32. * Remove warnings needed when miniz was included as a header library. * Set the C++ standard via 'flags' in premake. * Add support for 'implicit' paths. * Add testing for implicit directories. Better handling of implicit directories. * Improve comments in ZipFileSystem. * Update comment around reader/writer transformation. --- premake5.lua | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'premake5.lua') diff --git a/premake5.lua b/premake5.lua index 8835690ad..8b8a39933 100644 --- a/premake5.lua +++ b/premake5.lua @@ -202,7 +202,7 @@ workspace "slang" targetdir("bin/" .. targetName .. "/%{cfg.buildcfg:lower()}") -- Statically link to the C/C++ runtime rather than create a DLL dependency. - flags { "StaticRuntime" } + flags { "StaticRuntime", "C++11" } -- Once we've set up the common settings, we will make some tweaks -- that only apply in a subset of cases. Each call to `filter()` @@ -219,8 +219,10 @@ workspace "slang" filter { "platforms:aarch64"} architecture "ARM" + + filter { "toolset:clang or gcc*" } - buildoptions { "-Wno-unused-parameter", "-Wno-type-limits", "-Wno-sign-compare", "-Wno-unused-variable", "-Wno-reorder", "-Wno-switch", "-Wno-return-type", "-Wno-unused-local-typedefs", "-Wno-parentheses", "-std=c++11", "-fvisibility=hidden" , "-Wno-ignored-optimization-argument", "-Wno-unknown-warning-option", "-Wno-class-memaccess"} + buildoptions { "-Wno-unused-parameter", "-Wno-type-limits", "-Wno-sign-compare", "-Wno-unused-variable", "-Wno-reorder", "-Wno-switch", "-Wno-return-type", "-Wno-unused-local-typedefs", "-Wno-parentheses", "-fvisibility=hidden" , "-Wno-ignored-optimization-argument", "-Wno-unknown-warning-option", "-Wno-class-memaccess"} filter { "toolset:gcc*"} buildoptions { "-Wno-unused-but-set-variable", "-Wno-implicit-fallthrough" } @@ -633,7 +635,7 @@ tool "slang-embed" tool "slang-test" uuid "0C768A18-1D25-4000-9F37-DA5FE99E3B64" includedirs { "." } - links { "core", "slang" } + links { "core", "slang", "miniz" } -- -- The reflection test harness `slang-reflection-test` is pretty @@ -1046,6 +1048,23 @@ if enableProfile then end +standardProject "miniz" + uuid "E76ACB11-4A12-4F0A-BE1E-CE0B8836EB7F" + kind "StaticLib" + + files + { + "external/miniz/miniz.c", + "external/miniz/miniz_tdef.c", + "external/miniz/miniz_tinfl.c", + "external/miniz/miniz_zip.c" + } + + filter { "system:linux or macosx" } + links { "dl"} + buildoptions{"-fPIC"} + + if buildGlslang then standardProject "slang-spirv-tools" -- cgit v1.2.3