100 lines
3.3 KiB
Plaintext
100 lines
3.3 KiB
Plaintext
.ProjectName = 'JulietShaderCompiler'
|
|
.ProjectPath = 'JulietShaderCompiler'
|
|
|
|
// 1. Define the configurations and a container for the VS Project
|
|
.ShaderCompilerConfigs = { .X64ClangDebugConfig, .X64ClangReleaseConfig }
|
|
.ProjectConfigsShader = {}
|
|
.DXCSourcePath = '$ProjectPath$/DXShaderCompiler'
|
|
|
|
ForEach( .BuildConfig in .ShaderCompilerConfigs )
|
|
{
|
|
Using( .BuildConfig )
|
|
.OutputBase + '\$Platform$-$BuildConfigName$'
|
|
|
|
// 2. Define the Build Targets for this specific configuration
|
|
ObjectList( '$ProjectName$-Obs-$Platform$-$BuildConfigName$' )
|
|
{
|
|
.CompilerInputPath = '$ProjectPath$/'
|
|
.CompilerOutputPath = '$OutputBase$/$ProjectPath$/'
|
|
.CompilerOptions + ' "-IJuliet/include"'
|
|
+ ' "-IJulietShaderCompiler"'
|
|
|
|
#if __WINDOWS__
|
|
.CompilerOptions + ' -DJULIET_WIN32'
|
|
#endif
|
|
}
|
|
|
|
#if __WINDOWS__
|
|
Copy( '$ProjectName$-CopyDeps-$Platform$-$BuildConfigName$' )
|
|
{
|
|
.Source = {
|
|
'$DXCSourcePath$/dxcompiler.dll',
|
|
'$DXCSourcePath$/dxil.dll'
|
|
}
|
|
.Dest = '$BinPath$/$Platform$-$BuildConfigName$/'
|
|
}
|
|
#endif
|
|
|
|
Executable( '$ProjectName$-Exe-$Platform$-$BuildConfigName$' )
|
|
{
|
|
.Libraries = {
|
|
'Juliet-Lib-$Platform$-$BuildConfigName$',
|
|
'$ProjectName$-Obs-$Platform$-$BuildConfigName$'
|
|
}
|
|
|
|
.LinkerOutput = '$BinPath$/$Platform$-$BuildConfigName$/$ProjectName$$ExeExtension$'
|
|
|
|
#if __WINDOWS__
|
|
|
|
.CRTLibs = .CRTLibs_Dynamic
|
|
If ( .BuildConfigName == 'Debug' )
|
|
{
|
|
^CRTLibs = .CRTLibs_DynamicDebug
|
|
}
|
|
.LinkerOptions + .CRTLibs
|
|
|
|
.LinkerOptions + .CommonWinLibs + ' dxcompiler.lib'
|
|
#endif
|
|
|
|
#if __WINDOWS__
|
|
.PreBuildDependencies = { '$ProjectName$-CopyDeps-$Platform$-$BuildConfigName$' }
|
|
#endif
|
|
}
|
|
|
|
Alias( '$ProjectName$-$Platform$-$BuildConfigName$' ) { .Targets = '$ProjectName$-Exe-$Platform$-$BuildConfigName$' }
|
|
^'Targets_$Platform$_$BuildConfigName$' + { '$ProjectName$-$Platform$-$BuildConfigName$' }
|
|
|
|
#if __WINDOWS__
|
|
.ConfigInfo =
|
|
[
|
|
Using( .'Project_$Platform$_$BuildConfigName$' )
|
|
|
|
.LocalDebuggerCommandArguments = '..\..\Assets\source\SolidColor.frag.hlsl -o ..\..\Assets\compiled\SolidColor.frag.dxil'
|
|
|
|
.Target = '$ProjectName$-$Config$'
|
|
]
|
|
^ProjectConfigsShader + .ConfigInfo
|
|
#endif
|
|
}
|
|
|
|
// 4. Create the Project and Solution using the generated list
|
|
VCXProject( '$ProjectName$-Proj' )
|
|
{
|
|
.ProjectOutput = '$ProjectPath$/$ProjectName$.vcxproj'
|
|
.ProjectBasePath = '$ProjectPath$/'
|
|
.ProjectInputPaths = { .ProjectBasePath }
|
|
.ProjectConfigs = .ProjectConfigsShader
|
|
}
|
|
|
|
VSSolution( 'ShaderCompiler-Solution' )
|
|
{
|
|
.SolutionOutput = 'JulietShaderCompiler.sln'
|
|
.SolutionProjects = { '$ProjectName$-Proj' , 'Juliet' }
|
|
.SolutionConfigs = .ProjectConfigsShader
|
|
.SolutionBuildProject = '$ProjectName$-Proj'
|
|
}
|
|
|
|
// 5. Global Aliases
|
|
Alias( 'gen-shader' ) { .Targets = 'ShaderCompiler-Solution' }
|
|
Alias( 'shader' ) { .Targets = { '$ProjectName$-x64Clang-Release' } }
|
|
Alias( 'shader-debug' ) { .Targets = { '$ProjectName$-x64Clang-Debug', } } |