Skip to content

Commit 2252692

Browse files
author
Vicent Chen
committed
make ue4 official FASTBuild.cs happy
1 parent 98a7f04 commit 2252692

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

Code/Core/Core.bff

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
// Library
3030
//--------------------------------------------------------------------------
31-
ObjectList( '$ProjectName$-Lib-$Platform$-$BuildConfigName$' )
31+
ObjectList( '$ProjectName$-CPP-$Platform$-$BuildConfigName$' )
3232
{
3333
// Input
3434
.CompilerInputUnity = '$ProjectName$-Unity-$Platform$-$BuildConfigName$'
@@ -37,6 +37,10 @@
3737
// Output
3838
.CompilerOutputPath = '$OutputBase$/$ProjectPath$/'
3939
}
40+
Alias( '$ProjectName$-Lib-$Platform$-$BuildConfigName$' )
41+
{
42+
.Targets = { '$ProjectName$-CPP-$Platform$-$BuildConfigName$' }
43+
}
4044
Alias( '$ProjectName$-$Platform$-$BuildConfigName$' ) { .Targets = '$ProjectName$-Lib-$Platform$-$BuildConfigName$' }
4145
^'Targets_$Platform$_$BuildConfigName$' + { '$ProjectName$-$Platform$-$BuildConfigName$' }
4246

Code/Tools/FBuild/FBuildCore/Graph/CompilerNode.h

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class CompilerNode : public Node
5858
CompilerFamily GetCompilerFamily() const { return static_cast<CompilerFamily>( m_CompilerFamilyEnum ); }
5959

6060
const AString & GetExecutable() const { return m_StaticDependencies[ 0 ].GetNode()->GetName(); }
61+
const AString & GetExtraFile( size_t index ) const { return m_StaticDependencies[ index + 1 ].GetNode()->GetName(); }
6162
const char * GetEnvironmentString() const;
6263
const AString & GetSourceMapping() const { return m_SourceMapping; }
6364

Code/Tools/FBuild/FBuildCore/Graph/ObjectNode.cpp

+36
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ ObjectNode::~ObjectNode()
220220
bool useDist = GetFlag( FLAG_CAN_BE_DISTRIBUTED ) && m_AllowDistribution && FBuild::Get().GetOptions().m_AllowDistributed;
221221
bool useSimpleDist = GetCompiler()->SimpleDistributionMode();
222222
bool usePreProcessor = !useSimpleDist && ( useCache || useDist || GetFlag( FLAG_GCC ) || GetFlag( FLAG_SNC ) || GetFlag( FLAG_CLANG ) || GetFlag( FLAG_CLANG_CL ) || GetFlag( CODEWARRIOR_WII ) || GetFlag( GREENHILLS_WIIU ) || GetFlag( ObjectNode::FLAG_VBCC ) || GetFlag( FLAG_ORBIS_WAVE_PSSLC ) );
223+
// bool usePreProcessor = !useSimpleDist && ( useCache || useDist || GetFlag( FLAG_GCC ) || GetFlag( FLAG_SNC ) || ( GetFlag( FLAG_CLANG ) && useDist ) || GetFlag( CODEWARRIOR_WII ) || GetFlag( GREENHILLS_WIIU ) || GetFlag( ObjectNode::FLAG_VBCC ) || GetFlag( FLAG_ORBIS_WAVE_PSSLC ) );
223224
if ( GetDedicatedPreprocessor() )
224225
{
225226
usePreProcessor = true;
@@ -1985,6 +1986,41 @@ bool ObjectNode::BuildArgs( const Job * job, Args & fullArgs, Pass pass, bool us
19851986
}
19861987
}
19871988

1989+
// %5 -> FirstExtraFile
1990+
found = token.Find( "%5" );
1991+
if ( found )
1992+
{
1993+
AStackString<> extraFile;
1994+
if ( job->IsLocal() == false )
1995+
{
1996+
job->GetToolManifest()->GetRemoteFilePath( 1, extraFile );
1997+
}
1998+
1999+
fullArgs += AStackString<>( token.Get(), found );
2000+
fullArgs += job->IsLocal() ? GetCompiler()->GetExtraFile( 0 ) : extraFile;
2001+
fullArgs += AStackString<>( found + 2, token.GetEnd() );
2002+
fullArgs.AddDelimiter();
2003+
continue;
2004+
}
2005+
2006+
// %CLFilterDependenciesOutput -> file name Unreal Engine's cl-filter -dependencies param
2007+
// MSVC's /showIncludes option doesn't output anything when compiling a preprocessed file,
2008+
// so in that case we change the file name so that it doesn't override the file generated
2009+
// during preprocessing pass.
2010+
found = token.Find( "%CLFilterDependenciesOutput" );
2011+
if ( found )
2012+
{
2013+
AString nameWithoutExtension( m_Name );
2014+
PathUtils::StripFileExtension( nameWithoutExtension );
2015+
2016+
fullArgs += AStackString<>( token.Get(), found );
2017+
fullArgs += nameWithoutExtension;
2018+
fullArgs += pass == PASS_COMPILE_PREPROCESSED ? ".empty" : ".txt";
2019+
fullArgs += AStackString<>( found + 27, token.GetEnd() );
2020+
fullArgs.AddDelimiter();
2021+
continue;
2022+
}
2023+
19882024
// cl.exe treats \" as an escaped quote
19892025
// It's a common user error to terminate things (like include paths) with a quote
19902026
// this way, messing up the rest of the args and causing bizarre failures.

0 commit comments

Comments
 (0)