if(valid)
{
project.GenerateCompilerCf(defaultCompiler);
- project.GenerateCrossPlatformMk();
+ project.GenerateCrossPlatformMk(null);
if(project.GenerateMakefile(makePath, noResources, includemkPath, project.config))
{
if(makePath)
// driver = "OpenGL";
// skin = "Aqua";
//skin = "TVision";
+
+ TempFile includeFile { };
+
bool Init()
{
SetLoggingMode(stdOut, null);
ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, null, yes, normal);
}
*/
+
+ if(!LoadIncludeFile())
+ PrintLn("error: unable to load :crossplatform.mk file inside ide binary.");
+
return true;
}
+
+ bool LoadIncludeFile()
+ {
+ bool result = false;
+ File include = FileOpen(":crossplatform.mk", read);
+ if(include)
+ {
+ File f = includeFile;
+ if(f)
+ {
+ for(; !include.Eof(); )
+ {
+ char buffer[4096];
+ int count = include.Read(buffer, 1, 4096);
+ f.Write(buffer, 1, count);
+ }
+ result = true;
+ }
+ delete include;
+ }
+ return result;
+ }
}
IDEMainFrame ideMainFrame { };
}
}
- bool GenerateCrossPlatformMk()
+ bool GenerateCrossPlatformMk(File altCrossPlatformMk)
{
bool result = false;
char path[MAX_LOCATION];
if(FileExists(path))
DeleteFile(path);
{
- File include = FileOpen(":crossplatform.mk", read);
+ File include = altCrossPlatformMk ? altCrossPlatformMk : FileOpen(":crossplatform.mk", read);
if(include)
{
File f = FileOpen(path, write);
if(f)
{
+ include.Seek(0, start);
for(; !include.Eof(); )
{
char buffer[4096];
result = true;
}
- delete include;
+ if(!altCrossPlatformMk)
+ delete include;
}
}
return result;
bool ProjectPrepareCompiler(Project project, CompilerConfig compiler)
{
- if(!project.GenerateCrossPlatformMk() || !project.GenerateCompilerCf(compiler))
+ if(!project.GenerateCrossPlatformMk(app.includeFile) || !project.GenerateCompilerCf(compiler))
ide.outputView.buildBox.Logf($"Error generating compiler configuration (Is the project/config directory writable?)\n");
return true;
}