Пример #1
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * CopyDirNode::Load( NodeGraph & nodeGraph, IOStream & stream )
{
    NODE_LOAD( AStackString<>,  name);
    NODE_LOAD_DEPS( 4,          staticDeps );
    NODE_LOAD( AStackString<>,  destPath );
    NODE_LOAD_DEPS( 0,          preBuildDeps );

    CopyDirNode * n = nodeGraph.CreateCopyDirNode( name, staticDeps, destPath, preBuildDeps );
    ASSERT( n );
    return n;
}
Пример #2
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * ObjectListNode::Load( NodeGraph & nodeGraph, IOStream & stream )
{
    NODE_LOAD( AStackString<>,  name );
    NODE_LOAD_NODE( CompilerNode,   compilerNode );
    NODE_LOAD( AStackString<>,  compilerArgs );
    NODE_LOAD( AStackString<>,  compilerArgsDeoptimized );
    NODE_LOAD( AStackString<>,  compilerOutputPath );
    NODE_LOAD_DEPS( 16,         staticDeps );
    NODE_LOAD_NODE( Node,       precompiledHeader );
    NODE_LOAD( AStackString<>,  objExtensionOverride );
    NODE_LOAD( AStackString<>,  compilerOutputPrefix );
    NODE_LOAD_DEPS( 0,          compilerForceUsing );
    NODE_LOAD_DEPS( 0,          preBuildDependencies );
    NODE_LOAD( bool,            deoptimizeWritableFiles );
    NODE_LOAD( bool,            deoptimizeWritableFilesWithToken );
    NODE_LOAD( bool,            allowDistribution );
    NODE_LOAD( bool,            allowCaching );
    NODE_LOAD_NODE( CompilerNode, preprocessorNode );
    NODE_LOAD( AStackString<>,  preprocessorArgs );
    NODE_LOAD( AStackString<>,  baseDirectory );
    NODE_LOAD( AStackString<>,  extraPDBPath );
    NODE_LOAD( AStackString<>,  extraASMPath );

    ObjectListNode * n = nodeGraph.CreateObjectListNode( name,
                         staticDeps,
                         compilerNode,
                         compilerArgs,
                         compilerArgsDeoptimized,
                         compilerOutputPath,
                         precompiledHeader ? precompiledHeader->CastTo< ObjectNode >() : nullptr,
                         compilerForceUsing,
                         preBuildDependencies,
                         deoptimizeWritableFiles,
                         deoptimizeWritableFilesWithToken,
                         allowDistribution,
                         allowCaching,
                         preprocessorNode,
                         preprocessorArgs,
                         baseDirectory );
    n->m_ObjExtensionOverride = objExtensionOverride;
    n->m_CompilerOutputPrefix = compilerOutputPrefix;
    n->m_ExtraPDBPath = extraPDBPath;
    n->m_ExtraASMPath = extraASMPath;

    // TODO:B Need to save the dynamic deps, for better progress estimates
    // but we can't right now because we rely on the nodes we depend on
    // being saved before us which isn't the case for dynamic deps.
    //if ( Node::LoadDepArray( fileStream, n->m_DynamicDependencies ) == false )
    //{
    //  FDELETE n;
    //  return nullptr;
    //}
    return n;
}
Пример #3
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * CSNode::Load( IOStream & stream )
{
	NODE_LOAD( AStackString<>,	name );
	NODE_LOAD_DEPS( 2,			staticDeps );
	NODE_LOAD( AStackString<>,	compilerPath );
	NODE_LOAD( AStackString<>,	compilerArgs );
	NODE_LOAD_DEPS( 0,			extraRefs );

	ASSERT( staticDeps.GetSize() >= 1 );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	Node * on = ng.CreateCSNode( name, staticDeps, compilerPath, compilerArgs, extraRefs );
	CSNode * csNode = on->CastTo< CSNode >();
	return csNode;
}
Пример #4
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * CompilerNode::Load( IOStream & stream )
{
#ifdef USE_NODE_REFLECTION
	NODE_LOAD( AStackString<>, name );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	CompilerNode * cn = ng.CreateCompilerNode( name );

	if ( cn->Deserialize( stream ) == false )
	{
		return nullptr;
	}
	cn->m_Manifest.Deserialize( stream, false ); // false == not remote
	return cn;
#else
	NODE_LOAD( AStackString<>, exeName );
	NODE_LOAD_DEPS( 16,		   staticDeps );
	NODE_LOAD( bool,		   allowDistribution );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	CompilerNode * n = ng.CreateCompilerNode( exeName, staticDeps, allowDistribution );
	n->m_Manifest.Deserialize( stream, false ); // false == not remote
	return n;
#endif
}
Пример #5
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * ExecNode::Load( IOStream & stream )
{
    NODE_LOAD( AStackString<>,	fileName );
    NODE_LOAD( AStackString<>,	sourceFile );
    NODE_LOAD( AStackString<>,	executable );
    NODE_LOAD( AStackString<>,	arguments );
    NODE_LOAD( AStackString<>,	workingDir );
    NODE_LOAD( int32_t,			expectedReturnCode );
    NODE_LOAD_DEPS( 0,			preBuildDependencies );

    NodeGraph & ng = FBuild::Get().GetDependencyGraph();
    Node * srcNode = ng.FindNode( sourceFile );
    ASSERT( srcNode ); // load/save logic should ensure the src was saved first
    ASSERT( srcNode->IsAFile() );
    Node * execNode = ng.FindNode( executable );
    ASSERT( execNode ); // load/save logic should ensure the src was saved first
    ASSERT( execNode->IsAFile() );
    ExecNode * n = ng.CreateExecNode( fileName,
                                      (FileNode *)srcNode,
                                      (FileNode *)execNode,
                                      arguments,
                                      workingDir,
                                      expectedReturnCode,
                                      preBuildDependencies );
    ASSERT( n );

    return n;
}
Пример #6
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * SLNNode::Load( IOStream & stream )
{
    NODE_LOAD( AStackString<>,  name );
    NODE_LOAD( AStackString<>,  buildProject );
    NODE_LOAD( AStackString<>,  visualStudioVersion );
    NODE_LOAD( AStackString<>,  minimumVisualStudioVersion );
    NODE_LOAD_DEPS( 1,          staticDeps );

    Array< VSProjectConfig > configs;
    VSProjectConfig::Load( stream, configs );

    Array< SLNSolutionFolder > folders;
    SLNSolutionFolder::Load( stream, folders );

    Array< VCXProjectNode * > projects( staticDeps.GetSize(), false );
    const Dependency * const end = staticDeps.End();
    for ( const Dependency * it = staticDeps.Begin() ; it != end ; ++it )
    {
        projects.Append( it->GetNode()->CastTo< VCXProjectNode >() );
    }

    NodeGraph & ng = FBuild::Get().GetDependencyGraph();
    SLNNode * n = ng.CreateSLNNode( name,
                                    buildProject,
                                    visualStudioVersion,
                                    minimumVisualStudioVersion,
                                    configs,
                                    projects,
                                    folders );
    return n;
}
Пример #7
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * ExeNode::Load( IOStream & stream )
{
    // common Linker properties
	NODE_LOAD( AStackString<>,	name );
	NODE_LOAD( AStackString<>,	linker );
	NODE_LOAD( AStackString<>,	linkerArgs );
	NODE_LOAD_DEPS( 0,			inputLibs);
	NODE_LOAD( uint32_t,		flags );
	NODE_LOAD_DEPS( 0,			assemblyResources );
	NODE_LOAD_DEPS( 0,			otherLibs );
	NODE_LOAD( AStackString<>,	importLibName );
    NODE_LOAD_NODE( Node,		linkerStampExe );
    NODE_LOAD( AStackString<>,  linkerStampExeArgs );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	ExeNode * en = ng.CreateExeNode( name, inputLibs, otherLibs, linker, linkerArgs, flags, assemblyResources, importLibName, linkerStampExe, linkerStampExeArgs );
	return en;
}
Пример #8
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * AliasNode::Load( IOStream & stream )
{
#ifdef USE_NODE_REFLECTION
	NODE_LOAD( AStackString<>, name );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	AliasNode * an = ng.CreateAliasNode( name );

	if ( an->Deserialize( stream ) == false )
    {
		return nullptr;
	}
	return an;
#else
	NODE_LOAD( AStackString<>, name );
	NODE_LOAD_DEPS( 0, targets );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	return ng.CreateAliasNode( name, targets );
#endif
}
Пример #9
0
// Deserialize
//------------------------------------------------------------------------------
bool Node::Deserialize( IOStream & stream )
{
	// Deps
	NODE_LOAD_DEPS( 0,			preBuildDeps );
	ASSERT( m_PreBuildDependencies.IsEmpty() );
	m_PreBuildDependencies.Append( preBuildDeps );
	NODE_LOAD_DEPS( 0,			staticDeps );
	ASSERT( m_StaticDependencies.IsEmpty() );
	m_StaticDependencies.Append( staticDeps );
	NODE_LOAD_DEPS( 0,			dynamicDeps );
	ASSERT( m_DynamicDependencies.IsEmpty() );
	m_DynamicDependencies.Append( dynamicDeps );

	// Properties
	const ReflectionInfo * const ri = GetReflectionInfoV();
	const ReflectionIter end = ri->End();
	for ( ReflectionIter it = ri->Begin(); it != end; ++it )
	{
		const ReflectedProperty & property = *it;

		const PropertyType pt = property.GetType();
		switch ( pt )
		{
			case PT_ASTRING:
			{
				if ( property.IsArray() )
				{
					Array< AString > arrayOfStrings; // TODO:C Eliminate this copy
					if ( stream.Read( arrayOfStrings ) == false )
					{
						return false;
					}
					property.SetProperty( this, arrayOfStrings );
				}
				else
				{
					AStackString<> string; // TODO:C remove this copy
					if ( stream.Read( string ) == false )
					{
						return false;
					}
					property.SetProperty( this, string );
				}
				break;
			}
			case PT_BOOL:
			{
				bool b( false );
				if ( stream.Read( b ) == false )
				{
					return false;
				}
				property.SetProperty( this, b );
				break;
			}
			case PT_UINT32:
			{
				uint32_t u32( 0 );
				if ( stream.Read( u32 ) == false )
				{
					return false;
				}
				property.SetProperty( this, u32 );
				break;
			}
			default:
			{
				ASSERT( false ); // Unsupported type
				break;
			}
		}
	}

	return true;
}