1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Added reflection category to distinct build options (wip)

This commit is contained in:
Brian Fiete 2020-07-11 16:24:07 -07:00
parent 5cb6570e14
commit 037b2ac1e4
15 changed files with 538 additions and 94 deletions

View file

@ -5906,8 +5906,13 @@ void BfCompiler::CompileReified()
if (typeDef->mIsPartial)
continue;
auto scratchModule = mContext->mScratchModule;
bool isAlwaysInclude = (typeDef->mIsAlwaysInclude) || (typeDef->mProject->mAlwaysIncludeAll);
auto typeOptions = scratchModule->GetTypeOptions(typeDef);
if (typeOptions != NULL)
typeOptions->Apply(isAlwaysInclude, BfOptionFlags_ReflectAlwaysIncludeType);
if (typeDef->mProject->IsTestProject())
{
for (auto methodDef : typeDef->mMethods)
@ -5922,8 +5927,7 @@ void BfCompiler::CompileReified()
//TODO: Just because the type is required doesn't mean we want to reify it. Why did we have that check?
if ((mOptions.mCompileOnDemandKind != BfCompileOnDemandKind_AlwaysInclude) && (!isAlwaysInclude))
continue;
auto scratchModule = mContext->mScratchModule;
scratchModule->ResolveTypeDef(typeDef, BfPopulateType_Full);
}
@ -6396,7 +6400,15 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
for (auto typeDef : mSystem->mTypeDefs)
{
if ((typeDef->mIsAlwaysInclude) && (!typeDef->mIsPartial))
if (typeDef->mIsPartial)
continue;
bool isAlwaysInclude = (typeDef->mIsAlwaysInclude) || (typeDef->mProject->mAlwaysIncludeAll);
auto typeOptions = mContext->mScratchModule->GetTypeOptions(typeDef);
if (typeOptions != NULL)
isAlwaysInclude = typeOptions->Apply(isAlwaysInclude, BfOptionFlags_ReflectAlwaysIncludeType);
if (isAlwaysInclude)
{
auto requiredType = mContext->mScratchModule->ResolveTypeDef(typeDef);
if (requiredType != NULL)