merge
This commit is contained in:
@@ -120,124 +120,6 @@ void CMSVCCompiler::EnablePIC( CUtlVector<CUtlString> &cmd )
|
|||||||
|
|
||||||
|
|
||||||
EXPOSE_INTERFACE(CMSVCCompiler, ICCompiler, MSVC_C_COMPILER_INTERFACE_NAME);
|
EXPOSE_INTERFACE(CMSVCCompiler, ICCompiler, MSVC_C_COMPILER_INTERFACE_NAME);
|
||||||
/*
|
|
||||||
CUtlVector<ClangFile_t> g_msvcFiles;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
LinkProject_t CMSVCCompiler::Compile( CProject_t *pProject )
|
|
||||||
{
|
|
||||||
if (pProject->m_szName == 0)
|
|
||||||
{
|
|
||||||
Plat_FatalErrorFunc("m_szName must be present\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pProject->m_target.kernel != TARGET_KERNEL_WINDOWS_MSVC)
|
|
||||||
{
|
|
||||||
Plat_FatalErrorFunc("target must be TARGET_KERNEL_WINDOWS_MSVC\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
LinkProject_t proj = {};
|
|
||||||
proj.m_szName = pProject->m_szName;
|
|
||||||
proj.m_target = pProject->m_target;
|
|
||||||
proj.m_androidmanifest = pProject->m_androidmanifest;
|
|
||||||
unsigned int hash = pProject->GenerateProjectHash();
|
|
||||||
|
|
||||||
if (!g_pConfig)
|
|
||||||
Plat_FatalErrorFunc(".fpccfg was not found\n");
|
|
||||||
IINISection *pSection = g_pConfig->GetSection("MSVC_C_COMPILER_INTERFACE_NAME");
|
|
||||||
if (!pSection)
|
|
||||||
Plat_FatalErrorFunc("MSVC_C_COMPILER_INTERFACE_NAME was not found in .fpccfg\n");
|
|
||||||
CUtlString szExePath = pSection->GetStringValue("exe");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Get output directories
|
|
||||||
for (auto &file: pProject->files)
|
|
||||||
{
|
|
||||||
CUtlString szTarget = pProject->m_target.GetTriplet();
|
|
||||||
CUtlString szOutputFile = CUtlString("%s/%s/cc/%u_%s/%s/%s.obj",FPC_TEMPORAL_DIRNAME, szTarget.GetString(), hash, pProject->m_szName.GetString(), filesystem2->BuildDirectory(), file.GetString());
|
|
||||||
CUtlString szOutputDir = szOutputFile;
|
|
||||||
szOutputDir = dirname(szOutputDir);
|
|
||||||
filesystem2->MakeDirectory(szOutputDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run CC
|
|
||||||
for (auto &file: pProject->files)
|
|
||||||
{
|
|
||||||
V_printf(" CC %s\n", file.GetString());
|
|
||||||
|
|
||||||
CUtlVector<CUtlString> args;
|
|
||||||
CUtlString szTarget = pProject->m_target.GetTriplet();
|
|
||||||
CUtlString szCompiledTarget = szTarget;
|
|
||||||
bool bAreDependenciesUpdated = false;
|
|
||||||
if (pProject->m_target.kernel == TARGET_KERNEL_ANDROID)
|
|
||||||
{
|
|
||||||
szCompiledTarget = CUtlString("%s%u", szTarget.GetString(), pProject->m_androidmanifest.m_nTargetVersion);
|
|
||||||
}
|
|
||||||
CUtlString szOutputFile = CUtlString("%s/%s/cc/%u_%s/%s/%s.obj",FPC_TEMPORAL_DIRNAME, szTarget.GetString(), hash, pProject->m_szName.GetString(), filesystem2->BuildDirectory(), file.GetString());
|
|
||||||
|
|
||||||
args = {
|
|
||||||
"/nologo",
|
|
||||||
};
|
|
||||||
if (!strcmp(Plat_GetExtension(file),"cpp"))
|
|
||||||
args.AppendTail("-std=c++17");
|
|
||||||
else if (!strcmp(Plat_GetExtension(file),"mm"))
|
|
||||||
;
|
|
||||||
else
|
|
||||||
args.AppendTail("-std=c99");
|
|
||||||
|
|
||||||
if (pProject->bFPIC)
|
|
||||||
args.AppendTail("-fPIC");
|
|
||||||
if (pProject->bFPIE)
|
|
||||||
args.AppendTail("-fPIE");
|
|
||||||
for (auto ¯o: pProject->macros)
|
|
||||||
{
|
|
||||||
args.AppendTail(CUtlString("/D%s=%s", (char*)macro.szName, (char*)macro.szValue));
|
|
||||||
}
|
|
||||||
for (auto &include: pProject->includeDirectories)
|
|
||||||
{
|
|
||||||
const char *szWindowsPath = GetWindowsPath(include.GetString());
|
|
||||||
args.AppendTail(CUtlString("/I%s", szWindowsPath));
|
|
||||||
V_free((void*)szWindowsPath);
|
|
||||||
}
|
|
||||||
for (auto &include: pProject->includeFiles)
|
|
||||||
{
|
|
||||||
args.AppendTail("-include");
|
|
||||||
args.AppendTail(include);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!filesystem2->ShouldRecompile(file, szOutputFile) && !bAreDependenciesUpdated)
|
|
||||||
goto skipcompile;
|
|
||||||
|
|
||||||
args.AppendTail("/c");
|
|
||||||
args.AppendTail(CUtlString("/Fo%s", szOutputFile.GetString()));
|
|
||||||
args.AppendTail(file);
|
|
||||||
|
|
||||||
winerunner->Run(szExePath, args);
|
|
||||||
skipcompile:
|
|
||||||
proj.objects.AppendTail((Object_t){szOutputFile});
|
|
||||||
|
|
||||||
ClangFile_t cfile = {};
|
|
||||||
cfile.m_szName = file;
|
|
||||||
cfile.m_szArguments = args;
|
|
||||||
if (pProject->m_target.kernel == TARGET_KERNEL_ANDROID)
|
|
||||||
{
|
|
||||||
if (!pProject->m_target.szSysroot)
|
|
||||||
Plat_FatalErrorFunc("sysroot must be specified for android\n");
|
|
||||||
cfile.m_szArguments.AppendHead(CUtlString("%s/bin/clang", pProject->m_target.szSysroot));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cfile.m_szArguments.AppendHead("clang");
|
|
||||||
|
|
||||||
g_clangFiles.AppendTail(cfile);
|
|
||||||
}
|
|
||||||
winerunner->Wait();
|
|
||||||
return proj;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void CMSVCCompiler::GenerateLinterData()
|
void CMSVCCompiler::GenerateLinterData()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,14 +11,28 @@
|
|||||||
class CWineRunner: public IWineRunner
|
class CWineRunner: public IWineRunner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
CWineRunner();
|
||||||
|
~CWineRunner();
|
||||||
|
|
||||||
virtual int Run( CUtlString szName, CUtlVector<CUtlString>& args ) override;
|
virtual int Run( CUtlString szName, CUtlVector<CUtlString>& args ) override;
|
||||||
virtual int Run( CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args ) override;
|
virtual int Run( CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args ) override;
|
||||||
virtual int Run( CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args, CUtlVector<CUtlString>& environment ) override;
|
virtual int Run( CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args, CUtlVector<CUtlString>& environment ) override;
|
||||||
virtual int Wait( void ) override;
|
virtual int Wait( void ) override;
|
||||||
|
private:
|
||||||
|
pid_t m_wineServerPID;
|
||||||
};
|
};
|
||||||
|
|
||||||
EXPOSE_INTERFACE(CWineRunner, IWineRunner, WINE_RUNNER_INTERFACE_NAME);
|
EXPOSE_INTERFACE(CWineRunner, IWineRunner, WINE_RUNNER_INTERFACE_NAME);
|
||||||
|
|
||||||
|
CWineRunner::CWineRunner()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
CWineRunner::~CWineRunner()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
int CWineRunner::Run(CUtlString szName, CUtlVector<CUtlString>& args)
|
int CWineRunner::Run(CUtlString szName, CUtlVector<CUtlString>& args)
|
||||||
{
|
{
|
||||||
return runner->Run(szName, args);
|
return runner->Run(szName, args);
|
||||||
|
|||||||
Reference in New Issue
Block a user