diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-05-11 16:34:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-11 16:34:19 -0700 |
| commit | e2c2c220c642cc5f1c622f909d0ddfd22e6c04d4 (patch) | |
| tree | 2f8b2faa3ff61d07e106d4f049aa600b14ad8cf8 /slang.h | |
| parent | 34ecdb71c04232fba4b097f04fc358c57e704e26 (diff) | |
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).
Diffstat (limited to 'slang.h')
| -rw-r--r-- | slang.h | 48 |
1 files changed, 2 insertions, 46 deletions
@@ -1,10 +1,8 @@ #ifndef SLANG_H #define SLANG_H -#if defined(SLANG_DYNAMIC_EXPORT) - #if !defined(SLANG_DYNAMIC) - #define SLANG_DYNAMIC - #endif +#if !defined(SLANG_STATIC) && !defined(SLANG_STATIC) + #define SLANG_DYNAMIC #endif #if defined(SLANG_DYNAMIC) @@ -1259,46 +1257,4 @@ namespace slang #endif -#ifdef SLANG_INCLUDE_IMPLEMENTATION - -#include "source/core/platform.cpp" -#include "source/core/slang-io.cpp" -#include "source/core/slang-string.cpp" -#include "source/core/stream.cpp" -#include "source/core/text-io.cpp" -#include "source/slang/bytecode.cpp" -#include "source/slang/diagnostics.cpp" -#include "source/slang/dxc-support.cpp" -#include "source/slang/emit.cpp" -#include "source/slang/ir.cpp" -#include "source/slang/ir-constexpr.cpp" -#include "source/slang/ir-dominators.cpp" -#include "source/slang/ir-legalize-types.cpp" -#include "source/slang/ir-ssa.cpp" -#include "source/slang/ir-validate.cpp" -#include "source/slang/legalize-types.cpp" -#include "source/slang/lexer.cpp" -#include "source/slang/mangle.cpp" -#include "source/slang/memory_pool.cpp" -#include "source/slang/name.cpp" -#include "source/slang/options.cpp" -#include "source/slang/parameter-binding.cpp" -#include "source/slang/parser.cpp" -#include "source/slang/preprocessor.cpp" -#include "source/slang/profile.cpp" -#include "source/slang/lookup.cpp" -#include "source/slang/lower-to-ir.cpp" -#include "source/slang/check.cpp" -#include "source/slang/compiler.cpp" -#include "source/slang/slang-stdlib.cpp" -#include "source/slang/source-loc.cpp" -#include "source/slang/syntax.cpp" -#include "source/slang/token.cpp" -#include "source/slang/type-layout.cpp" -#include "source/slang/reflection.cpp" -#include "source/slang/slang.cpp" -#include "source/slang/vm.cpp" -#include "source/slang/type-system-shared.cpp" -#endif - #endif |
