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 /source/core | |
| 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 'source/core')
| -rw-r--r-- | source/core/core.vcxproj | 193 | ||||
| -rw-r--r-- | source/core/core.vcxproj.filters | 119 |
2 files changed, 216 insertions, 96 deletions
diff --git a/source/core/core.vcxproj b/source/core/core.vcxproj index 803c1ab12..ecd8ee07b 100644 --- a/source/core/core.vcxproj +++ b/source/core/core.vcxproj @@ -18,196 +18,197 @@ <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> - <ItemGroup> - <ClInclude Include="allocator.h" /> - <ClInclude Include="array-view.h" /> - <ClInclude Include="array.h" /> - <ClInclude Include="basic.h" /> - <ClInclude Include="common.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="exception.h" /> - <ClInclude Include="hash.h" /> - <ClInclude Include="int-set.h" /> - <ClInclude Include="list.h" /> - <ClInclude Include="secure-crt.h" /> - <ClInclude Include="slang-com-ptr.h" /> - <ClInclude Include="slang-defines.h" /> - <ClInclude Include="slang-free-list.h" /> - <ClInclude Include="slang-io.h" /> - <ClInclude Include="slang-math.h" /> - <ClInclude Include="slang-result.h" /> - <ClInclude Include="slang-string-util.h" /> - <ClInclude Include="slang-string.h" /> - <ClInclude Include="smart-pointer.h" /> - <ClInclude Include="stream.h" /> - <ClInclude Include="text-io.h" /> - <ClInclude Include="token-reader.h" /> - <ClInclude Include="type-traits.h" /> - </ItemGroup> - <ItemGroup> - <ClCompile Include="platform.cpp" /> - <ClCompile Include="slang-free-list.cpp" /> - <ClCompile Include="slang-io.cpp" /> - <ClCompile Include="slang-string-util.cpp" /> - <ClCompile Include="slang-string.cpp" /> - <ClCompile Include="stream.cpp" /> - <ClCompile Include="text-io.cpp" /> - <ClCompile Include="token-reader.cpp" /> - </ItemGroup> - <ItemGroup> - <Natvis Include="core.natvis" /> - </ItemGroup> - <PropertyGroup Label="Globals" /> - <PropertyGroup Label="Globals"> - </PropertyGroup> <PropertyGroup Label="Globals"> - </PropertyGroup> - <PropertyGroup Label="Globals"> - </PropertyGroup> - <PropertyGroup Label="Globals"> - <Keyword>Win32Proj</Keyword> - <RootNamespace>CoreLib</RootNamespace> <ProjectGuid>{F9BE7957-8399-899E-0C49-E714FDDD4B65}</ProjectGuid> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename> + <Keyword>Win32Proj</Keyword> + <RootNamespace>core</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> - <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> - <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="..\..\build\slang-build.props" /> </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="..\..\build\slang-build.props" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="..\..\build\slang-build.props" /> </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="..\..\build\slang-build.props" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> - <PropertyGroup /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <OutDir>..\..\bin\windows-x86\debug\</OutDir> + <IntDir>..\..\intermediate\windows-x86\debug\core\</IntDir> + <TargetName>core</TargetName> + <TargetExt>.lib</TargetExt> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <OutDir>..\..\bin\windows-x64\debug\</OutDir> + <IntDir>..\..\intermediate\windows-x64\debug\core\</IntDir> + <TargetName>core</TargetName> + <TargetExt>.lib</TargetExt> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <OutDir>..\..\bin\windows-x86\release\</OutDir> + <IntDir>..\..\intermediate\windows-x86\release\core\</IntDir> + <TargetName>core</TargetName> + <TargetExt>.lib</TargetExt> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <OutDir>..\..\bin\windows-x64\release\</OutDir> + <IntDir>..\..\intermediate\windows-x64\release\core\</IntDir> + <TargetName>core</TargetName> + <TargetExt>.lib</TargetExt> + </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> + <PrecompiledHeader>NotUsing</PrecompiledHeader> <WarningLevel>Level4</WarningLevel> + <TreatWarningAsError>true</TreatWarningAsError> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;WINDOWS_PLATFORM;%(PreprocessorDefinitions);GLEW_STATIC</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <MultiProcessorCompilation>false</MultiProcessorCompilation> - <BasicRuntimeChecks>Default</BasicRuntimeChecks> - <TreatWarningAsError>true</TreatWarningAsError> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> </Link> <Lib> - <AdditionalDependencies>Shlwapi.lib</AdditionalDependencies> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> + <PrecompiledHeader>NotUsing</PrecompiledHeader> <WarningLevel>Level4</WarningLevel> + <TreatWarningAsError>true</TreatWarningAsError> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;WINDOWS_PLATFORM;%(PreprocessorDefinitions);GLEW_STATIC</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <BrowseInformation>true</BrowseInformation> - <MultiProcessorCompilation>false</MultiProcessorCompilation> - <BasicRuntimeChecks>Default</BasicRuntimeChecks> - <TreatWarningAsError>true</TreatWarningAsError> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> </Link> <Lib> - <AdditionalDependencies>Shlwapi.lib</AdditionalDependencies> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> </Lib> - <Bscmake> - <PreserveSbr>true</PreserveSbr> - </Bscmake> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> <WarningLevel>Level4</WarningLevel> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> + <TreatWarningAsError>true</TreatWarningAsError> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Optimization>Full</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;WINDOWS_PLATFORM;%(PreprocessorDefinitions);GLEW_STATIC</PreprocessorDefinitions> + <MinimalRebuild>false</MinimalRebuild> + <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <MultiProcessorCompilation>false</MultiProcessorCompilation> - <TreatWarningAsError>true</TreatWarningAsError> </ClCompile> <Link> <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> <Lib> - <AdditionalDependencies>Shlwapi.lib</AdditionalDependencies> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> <WarningLevel>Level4</WarningLevel> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> + <TreatWarningAsError>true</TreatWarningAsError> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Optimization>Full</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;WINDOWS_PLATFORM;%(PreprocessorDefinitions);GLEW_STATIC</PreprocessorDefinitions> + <MinimalRebuild>false</MinimalRebuild> + <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <MultiProcessorCompilation>false</MultiProcessorCompilation> - <TreatWarningAsError>true</TreatWarningAsError> </ClCompile> <Link> <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> <Lib> - <AdditionalDependencies>Shlwapi.lib</AdditionalDependencies> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> </Lib> </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="allocator.h" /> + <ClInclude Include="array-view.h" /> + <ClInclude Include="array.h" /> + <ClInclude Include="basic.h" /> + <ClInclude Include="common.h" /> + <ClInclude Include="dictionary.h" /> + <ClInclude Include="exception.h" /> + <ClInclude Include="hash.h" /> + <ClInclude Include="int-set.h" /> + <ClInclude Include="list.h" /> + <ClInclude Include="platform.h" /> + <ClInclude Include="secure-crt.h" /> + <ClInclude Include="slang-com-ptr.h" /> + <ClInclude Include="slang-defines.h" /> + <ClInclude Include="slang-free-list.h" /> + <ClInclude Include="slang-io.h" /> + <ClInclude Include="slang-math.h" /> + <ClInclude Include="slang-result.h" /> + <ClInclude Include="slang-string-util.h" /> + <ClInclude Include="slang-string.h" /> + <ClInclude Include="smart-pointer.h" /> + <ClInclude Include="stream.h" /> + <ClInclude Include="text-io.h" /> + <ClInclude Include="token-reader.h" /> + <ClInclude Include="type-traits.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="platform.cpp" /> + <ClCompile Include="slang-free-list.cpp" /> + <ClCompile Include="slang-io.cpp" /> + <ClCompile Include="slang-string-util.cpp" /> + <ClCompile Include="slang-string.cpp" /> + <ClCompile Include="stream.cpp" /> + <ClCompile Include="text-io.cpp" /> + <ClCompile Include="token-reader.cpp" /> + </ItemGroup> + <ItemGroup> + <None Include="core.natvis" /> + </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> diff --git a/source/core/core.vcxproj.filters b/source/core/core.vcxproj.filters new file mode 100644 index 000000000..39a164770 --- /dev/null +++ b/source/core/core.vcxproj.filters @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Header Files"> + <UniqueIdentifier>{21EB8090-0D4E-1035-B6D3-48EBA215DCB7}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files"> + <UniqueIdentifier>{E9C7FDCE-D52A-8D73-7EB0-C5296AF258F6}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="allocator.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="array-view.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="array.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="basic.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="common.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="dictionary.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="exception.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="hash.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="int-set.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="list.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="platform.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="secure-crt.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="slang-com-ptr.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="slang-defines.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="slang-free-list.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="slang-io.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="slang-math.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="slang-result.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="slang-string-util.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="slang-string.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="smart-pointer.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="stream.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="text-io.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="token-reader.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="type-traits.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="platform.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="slang-free-list.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="slang-io.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="slang-string-util.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="slang-string.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="stream.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="text-io.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="token-reader.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <None Include="core.natvis"> + <Filter>Source Files</Filter> + </None> + </ItemGroup> +</Project>
\ No newline at end of file |
