From e2c2c220c642cc5f1c622f909d0ddfd22e6c04d4 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 11 May 2018 16:34:19 -0700 Subject: Generate Visual Studio projects using Premake (#557) * Generate Visual Studio projects using Premake This change adds a `premake5.lua` file that allows us to generate our Visual Studio solution using Premake 5 (https://premake.github.io/). The existing Visual Studio solution/projects are now replaced with the Premake-generated ones, and project contributors will be expected to update these by running premake after adding/removing files. I have *not* changed the Linux `Makefile` build at all, because that file is also used for things like running our tests, so that clobbering it with a premake-generated `Makefile` would break our continuous testing. Hopefully future changes can switch to a generated `Makefile` and perhaps even add an XCode project as well. Notes: * The `build/slang-build.props` file is no longer needed/used, so it has been removed. * The `slang-eval-test` test fixture wasn't following our naming conventions for its directory path, so it was updated to streamline the Premake build configuration work. This required changes to the `Makefile` as well * Some seemingly unncessary preprocessor definitions that were specified for `core` and `slang-glslang` have been dropped. We will see if anything breaks from that. * Possible fixup for Premake vpath issue Premake's `vpath` feature seems to be nondeterministic about the order it applies filters (because Lua isn't deterministic about the order of entries in a key/value table), and as a result we can end up in a weird case where it decides that a `foo.cpp.h` file matches the `**.cpp` filter (I'm not sure why) before it tests against the `**.h` filter. This change uses an (undocumented) Premake facility to set `vpath` using a list of singleton tables, which seems to fix the order in which things get tested. * Remove support for "single-file" build of Slang The `hello` example was the only bit of code that uses the "single-file" way of building Slang, and this had already run up against limitations of the Visual Studio compilers in its Debug|x64 build. Rather than mess with Premake to make it pass through the `/bigobj` linker flag that is needed to work around the issue, it makes more sense just to stop using/supporting the feature since we wouldn't want users to depend on it anyway (our documentation no longer refers to it). While I was at it I went ahead and made sure that the `SLANG_DYNAMIC` flag doesn't need to be set manually, so that instead there is a non-default `SLANG_STATIC` option (not that we have a static-library build of Slang at the moment). --- source/slang/slang.vcxproj | 173 +++++++++---------- source/slang/slang.vcxproj.filters | 344 ++++++++++++++++++++++++++++--------- 2 files changed, 345 insertions(+), 172 deletions(-) (limited to 'source/slang') diff --git a/source/slang/slang.vcxproj b/source/slang/slang.vcxproj index fa75d7378..f32355e83 100644 --- a/source/slang/slang.vcxproj +++ b/source/slang/slang.vcxproj @@ -20,163 +20,167 @@ {DB00DA62-0533-4AFD-B59F-A67D5B3A0808} + true Win32Proj slang - slang - 8.1 DynamicLibrary true - v140 Unicode + v140 DynamicLibrary true - v140 Unicode + v140 DynamicLibrary false - v140 - true Unicode + v140 DynamicLibrary false - v140 - true Unicode + v140 - - + - - - + - true + ..\..\bin\windows-x86\debug\ + ..\..\intermediate\windows-x86\debug\slang\ + slang + .dll true + ..\..\bin\windows-x64\debug\ + ..\..\intermediate\windows-x64\debug\slang\ + slang + .dll false + ..\..\bin\windows-x86\release\ + ..\..\intermediate\windows-x86\release\slang\ + slang + .dll false + ..\..\bin\windows-x64\release\ + ..\..\intermediate\windows-x64\release\slang\ + slang + .dll - - + NotUsing Level4 + true + _DEBUG;SLANG_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + EditAndContinue Disabled - SLANG_DYNAMIC;SLANG_DYNAMIC_EXPORT;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - ../ MultiThreadedDebug - false - true - Console + Windows true + ..\..\bin\windows-x86\debug\slang.lib + true - - + NotUsing Level4 + true + _DEBUG;SLANG_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + EditAndContinue Disabled - SLANG_DYNAMIC;SLANG_DYNAMIC_EXPORT;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - ../ MultiThreadedDebug - true - false - true - Console + Windows true + ..\..\bin\windows-x64\debug\slang.lib + true - - true - + NotUsing Level4 - - - MaxSpeed + true + NDEBUG;SLANG_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + Full true true - SLANG_DYNAMIC;SLANG_DYNAMIC_EXPORT;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - ../ + false + true MultiThreaded - false - true - Console - true + Windows true true + ..\..\bin\windows-x86\release\slang.lib + true + NotUsing Level4 - - - MaxSpeed + true + NDEBUG;SLANG_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + Full true true - SLANG_DYNAMIC;SLANG_DYNAMIC_EXPORT;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - ../ + false + true MultiThreaded - false - true - Console - true + Windows true true + ..\..\bin\windows-x64\release\slang.lib + true - - - - + + + @@ -251,50 +255,41 @@ - - {f9be7957-8399-899e-0c49-e714fddd4b65} - + Document - $(OutDir)slang-generate.exe %(Identity) - slang-generate %(Identity) - %(Identity).cpp - $(OutDir)slang-generate.exe - $(OutDir)slang-generate.exe %(Identity) - slang-generate %(Identity) - %(Identity).cpp - $(OutDir)slang-generate.exe - $(OutDir)slang-generate.exe %(Identity) - slang-generate %(Identity) - %(Identity).cpp - $(OutDir)slang-generate.exe - $(OutDir)slang-generate.exe %(Identity) - slang-generate %(Identity) - %(Identity).cpp - $(OutDir)slang-generate.exe + "../../bin/windows-x86/debug/slang-generate" %(Identity) + "../../bin/windows-x64/debug/slang-generate" %(Identity) + "../../bin/windows-x86/release/slang-generate" %(Identity) + "../../bin/windows-x64/release/slang-generate" %(Identity) + %(Identity).h + slang-generate %(Identity) + ../../bin/windows-x86/debug/slang-generate.exe + ../../bin/windows-x64/debug/slang-generate.exe + ../../bin/windows-x86/release/slang-generate.exe + ../../bin/windows-x64/release/slang-generate.exe Document - $(OutDir)slang-generate.exe %(Identity) - $(OutDir)slang-generate.exe %(Identity) - $(OutDir)slang-generate.exe %(Identity) - $(OutDir)slang-generate.exe %(Identity) - slang-generate %(Identity) - slang-generate %(Identity) - slang-generate %(Identity) - slang-generate %(Identity) - %(Identity).cpp - %(Identity).cpp - %(Identity).cpp - %(Identity).cpp - $(OutDir)slang-generate.exe - $(OutDir)slang-generate.exe - $(OutDir)slang-generate.exe - $(OutDir)slang-generate.exe + "../../bin/windows-x86/debug/slang-generate" %(Identity) + "../../bin/windows-x64/debug/slang-generate" %(Identity) + "../../bin/windows-x86/release/slang-generate" %(Identity) + "../../bin/windows-x64/release/slang-generate" %(Identity) + %(Identity).h + slang-generate %(Identity) + ../../bin/windows-x86/debug/slang-generate.exe + ../../bin/windows-x64/debug/slang-generate.exe + ../../bin/windows-x86/release/slang-generate.exe + ../../bin/windows-x64/release/slang-generate.exe + + + {F9BE7957-8399-899E-0C49-E714FDDD4B65} + + diff --git a/source/slang/slang.vcxproj.filters b/source/slang/slang.vcxproj.filters index 90b542551..991fe9c44 100644 --- a/source/slang/slang.vcxproj.filters +++ b/source/slang/slang.vcxproj.filters @@ -1,93 +1,271 @@ - + - - + + {21EB8090-0D4E-1035-B6D3-48EBA215DCB7} + + + {E9C7FDCE-D52A-8D73-7EB0-C5296AF258F6} + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + - - + + Source Files + + + + + Source Files + + + Source Files + \ No newline at end of file -- cgit v1.2.3