diff --git a/Code/Core/Core.bff b/Code/Core/Core.bff index f7b6003cc..54be1dbdb 100644 --- a/Code/Core/Core.bff +++ b/Code/Core/Core.bff @@ -28,7 +28,7 @@ // Library //-------------------------------------------------------------------------- - ObjectList( '$ProjectName$-Lib-$Platform$-$BuildConfigName$' ) + ObjectList( '$ProjectName$-CPP-$Platform$-$BuildConfigName$' ) { // Input .CompilerInputUnity = '$ProjectName$-Unity-$Platform$-$BuildConfigName$' @@ -37,6 +37,10 @@ // Output .CompilerOutputPath = '$OutputBase$/$ProjectPath$/' } + Alias( '$ProjectName$-Lib-$Platform$-$BuildConfigName$' ) + { + .Targets = { '$ProjectName$-CPP-$Platform$-$BuildConfigName$' } + } Alias( '$ProjectName$-$Platform$-$BuildConfigName$' ) { .Targets = '$ProjectName$-Lib-$Platform$-$BuildConfigName$' } ^'Targets_$Platform$_$BuildConfigName$' + { '$ProjectName$-$Platform$-$BuildConfigName$' } diff --git a/Code/Tools/FBuild/FBuildCore/Graph/CompilerNode.h b/Code/Tools/FBuild/FBuildCore/Graph/CompilerNode.h index 08b9e94b7..3072e416b 100644 --- a/Code/Tools/FBuild/FBuildCore/Graph/CompilerNode.h +++ b/Code/Tools/FBuild/FBuildCore/Graph/CompilerNode.h @@ -58,6 +58,7 @@ class CompilerNode : public Node CompilerFamily GetCompilerFamily() const { return static_cast( m_CompilerFamilyEnum ); } const AString & GetExecutable() const { return m_StaticDependencies[ 0 ].GetNode()->GetName(); } + const AString & GetExtraFile( size_t index ) const { return m_StaticDependencies[ index + 1 ].GetNode()->GetName(); } const char * GetEnvironmentString() const; const AString & GetSourceMapping() const { return m_SourceMapping; } diff --git a/Code/Tools/FBuild/FBuildCore/Graph/ObjectNode.cpp b/Code/Tools/FBuild/FBuildCore/Graph/ObjectNode.cpp index 9bef7406d..f54a4e11b 100644 --- a/Code/Tools/FBuild/FBuildCore/Graph/ObjectNode.cpp +++ b/Code/Tools/FBuild/FBuildCore/Graph/ObjectNode.cpp @@ -220,6 +220,7 @@ ObjectNode::~ObjectNode() bool useDist = GetFlag( FLAG_CAN_BE_DISTRIBUTED ) && m_AllowDistribution && FBuild::Get().GetOptions().m_AllowDistributed; bool useSimpleDist = GetCompiler()->SimpleDistributionMode(); 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 ) ); + // 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 ) ); if ( GetDedicatedPreprocessor() ) { usePreProcessor = true; @@ -1985,6 +1986,41 @@ bool ObjectNode::BuildArgs( const Job * job, Args & fullArgs, Pass pass, bool us } } + // %5 -> FirstExtraFile + found = token.Find( "%5" ); + if ( found ) + { + AStackString<> extraFile; + if ( job->IsLocal() == false ) + { + job->GetToolManifest()->GetRemoteFilePath( 1, extraFile ); + } + + fullArgs += AStackString<>( token.Get(), found ); + fullArgs += job->IsLocal() ? GetCompiler()->GetExtraFile( 0 ) : extraFile; + fullArgs += AStackString<>( found + 2, token.GetEnd() ); + fullArgs.AddDelimiter(); + continue; + } + + // %CLFilterDependenciesOutput -> file name Unreal Engine's cl-filter -dependencies param + // MSVC's /showIncludes option doesn't output anything when compiling a preprocessed file, + // so in that case we change the file name so that it doesn't override the file generated + // during preprocessing pass. + found = token.Find( "%CLFilterDependenciesOutput" ); + if ( found ) + { + AString nameWithoutExtension( m_Name ); + PathUtils::StripFileExtension( nameWithoutExtension ); + + fullArgs += AStackString<>( token.Get(), found ); + fullArgs += nameWithoutExtension; + fullArgs += pass == PASS_COMPILE_PREPROCESSED ? ".empty" : ".txt"; + fullArgs += AStackString<>( found + 27, token.GetEnd() ); + fullArgs.AddDelimiter(); + continue; + } + // cl.exe treats \" as an escaped quote // It's a common user error to terminate things (like include paths) with a quote // this way, messing up the rest of the args and causing bizarre failures.