added compile_commands.json
This commit is contained in:
33
fpc/main.cpp
33
fpc/main.cpp
@@ -1,3 +1,4 @@
|
||||
#include "public/c.h"
|
||||
#include "public/helper.h"
|
||||
#include "public/ld.h"
|
||||
#include "tier0/platform.h"
|
||||
@@ -5,13 +6,18 @@
|
||||
#include "c.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "signal.h"
|
||||
#include "libgen.h"
|
||||
|
||||
CUtlString owndir;
|
||||
int build()
|
||||
{
|
||||
|
||||
extern char *szBuildDir;
|
||||
|
||||
CCProject compileScriptProject = {};
|
||||
compileScriptProject.m_szName = "build";
|
||||
compileScriptProject.files = {"build.cpp"};
|
||||
compileScriptProject.includeDirectories = {"public","../public"};
|
||||
compileScriptProject.includeDirectories = {CUtlString("%s/public",IFileSystem2::OwnDirectory()),CUtlString("%s/public", IFileSystem2::BuildDirectory()), CUtlString("%s/../public",IFileSystem2::OwnDirectory()),CUtlString("%s/../public", IFileSystem2::BuildDirectory())};
|
||||
compileScriptProject.bFPIC = true;
|
||||
CLDProject linkScriptProject = compileScriptProject.Compile();
|
||||
linkScriptProject.linkType = ELINK_DYNAMIC_LIBRARY;
|
||||
@@ -22,6 +28,7 @@ int build()
|
||||
build->m_pMainFn();
|
||||
};
|
||||
Plat_UnloadLibrary(scriptDLL);
|
||||
CCProject::GenerateCompileCommands();
|
||||
|
||||
return 0;
|
||||
};
|
||||
@@ -42,7 +49,28 @@ void IEngine_Signal(int sig)
|
||||
};
|
||||
|
||||
int main(int c, char **v)
|
||||
{
|
||||
{
|
||||
CUtlString buildcppDir = IFileSystem2::OwnDirectory();
|
||||
owndir = buildcppDir;
|
||||
char *szBuildcppDir = buildcppDir.GetString();
|
||||
findbuild:
|
||||
FILE* file = V_fopen("build.cpp", "rb");
|
||||
if (!file)
|
||||
{
|
||||
dirname(szBuildcppDir);
|
||||
if (buildcppDir=="/")
|
||||
{
|
||||
V_printf("build.cpp not found\n");
|
||||
return 0;
|
||||
}
|
||||
chdir(szBuildcppDir);
|
||||
goto findbuild;
|
||||
} else {
|
||||
V_fclose(file);
|
||||
}
|
||||
extern char *szBuildDir;
|
||||
szBuildDir = szBuildcppDir;
|
||||
|
||||
#ifdef __linux
|
||||
signal(SIGHUP, IEngine_Signal);
|
||||
signal(SIGINT, IEngine_Signal);
|
||||
@@ -54,7 +82,6 @@ int main(int c, char **v)
|
||||
signal(SIGFPE, IEngine_Signal);
|
||||
signal(SIGSEGV, IEngine_Signal);
|
||||
signal(SIGTERM, IEngine_Signal);
|
||||
V_printf("cool\n");
|
||||
#endif
|
||||
ICommandLine::CreateCommandLine(c, v);
|
||||
if (ICommandLine::CheckParam("build"))
|
||||
|
||||
Reference in New Issue
Block a user