some improvements i think
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# We want to build just enough to use other stuff
|
||||
TIER0_FILES := ../tier0/lib.cpp ../tier0/mem.cpp ../tier0/platform.cpp ../tier0/commandline.cpp ../tier0/rand.cpp
|
||||
TIER1_FILES := ../tier1/utlbuffer.cpp ../tier1/interface.cpp ../tier1/utlstring.cpp ../tier1/utlvector.cpp ../tier1/utlmap.cpp
|
||||
TIER2_FILES := ../tier2/filesystem.cpp ../tier2/fileformats/ini.cpp
|
||||
TIER2_FILES := ../tier2/filesystem.cpp ../tier2/fileformats/ini.cpp ../tier2/tokenizer.cpp ../tier2/fileformats/json.cpp
|
||||
FILESYSTEM_FILES := ../stdfilesystems/filesystem_libc.cpp
|
||||
TIER1_OBJS := $(TIER1_FILES:.cpp=.o)
|
||||
TIER2_OBJS := $(TIER2_FILES:.cpp=.o)
|
||||
@@ -57,8 +57,8 @@ build/libfilesystem_std.so: $(FILESYSTEM_FILES) build/libtier1.a build/libtier0.
|
||||
build/libfpcbuild.a: buildfile/interfaces.o builddir
|
||||
ar rcs build/libfpcbuild.a buildfile/interfaces.o
|
||||
|
||||
build/libfpc.so: $(FPC_FILES) builddir build/libfpcbuild.a build/libtier1.a
|
||||
$(CC) $(CCFLAGS) $(FPC_FILES) library/libfpc.cpp -fPIC -shared -o build/libfpc.so build/libtier1.a
|
||||
build/libfpc.so: $(FPC_FILES) builddir build/libfpcbuild.a build/libtier1.a build/libtier2.a
|
||||
$(CC) $(CCFLAGS) $(FPC_FILES) library/libfpc.cpp -fPIC -shared -o build/libfpc.so build/libtier1.a build/libtier2.a
|
||||
|
||||
builddir:
|
||||
mkdir -p build
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "tier1/interface.h"
|
||||
#include "tier1/utlstring.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier2/fileformats/json.h"
|
||||
#include "libgen.h"
|
||||
#include "ctype.h"
|
||||
|
||||
@@ -245,23 +246,33 @@ skipcompile:
|
||||
|
||||
void CClangCompiler::GenerateLinterData()
|
||||
{
|
||||
CUtlVector<IJSONValue*> jsonValues = {};
|
||||
FILE* f = V_fopen("compile_commands.json", "wb");
|
||||
V_fprintf(f, "[\n");
|
||||
uint32_t i = 0;
|
||||
for (auto &file: g_clangFiles)
|
||||
for ( auto &f: g_clangFiles )
|
||||
{
|
||||
V_fprintf(f, "\t{\n");
|
||||
V_fprintf(f, "\t\t\"arguments\": [\n");
|
||||
for (auto &arg: file.m_szArguments)
|
||||
V_fprintf(f, "\t\t\t\"%s\",\n",arg.GetString());
|
||||
|
||||
V_fseek(f, -2, SEEK_CUR);
|
||||
V_fprintf(f, "\n\t\t],\n");
|
||||
V_fprintf(f, "\t\t\"file\": \"%s\",\n", file.m_szName.GetString());
|
||||
V_fprintf(f, "\t\t\"directory\": \"%s\"\n", filesystem2->BuildDirectory());
|
||||
V_fprintf(f, "\t},\n");
|
||||
IJSONObject *pFileObject = JSONManager()->CreateObject();
|
||||
IJSONValue *pFileValue = JSONManager()->CreateValue();
|
||||
IJSONArray *pArgumentFiles = JSONManager()->CreateArray();
|
||||
IJSONValue *pArgumentsValue = JSONManager()->CreateValue();
|
||||
CUtlVector<IJSONValue*> values;
|
||||
|
||||
for (auto &arg: f.m_szArguments)
|
||||
{
|
||||
IJSONValue *pFileValue = JSONManager()->CreateValue();
|
||||
pFileValue->SetStringValue(arg.GetString());
|
||||
values.AppendTail(pFileValue);
|
||||
}
|
||||
pArgumentFiles->SetArray(values.GetSize(), values.GetData());
|
||||
pArgumentsValue->SetArrayValue(pArgumentFiles);
|
||||
pFileObject->SetValue("arguments", pArgumentsValue);
|
||||
pFileValue->SetObjectValue(pFileObject);
|
||||
jsonValues.AppendTail(pFileValue);
|
||||
};
|
||||
V_fseek(f, -2, SEEK_CUR);
|
||||
V_fprintf(f, "\n]\n");
|
||||
IJSONArray *pArray = JSONManager()->CreateArray();
|
||||
pArray->SetArray(jsonValues.GetSize(), jsonValues.GetData());
|
||||
IJSONValue *pRoot = JSONManager()->CreateValue();
|
||||
pRoot->SetArrayValue(pArray);
|
||||
CUtlString szCommands = JSONManager()->WriteString(pRoot);
|
||||
V_printf("JSON\n%s\n",szCommands.GetString());
|
||||
V_fclose(f);
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "tier0/commandline.h"
|
||||
#include "tier1/interface.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier1/utlstring.h"
|
||||
#include "tier2/ifilesystem.h"
|
||||
#include "tier2/fileformats/ini.h"
|
||||
#include "public/c.h"
|
||||
|
||||
0
fpc/sysroots/ios.cpp
Normal file
0
fpc/sysroots/ios.cpp
Normal file
0
fpc/sysroots/macos.cpp
Normal file
0
fpc/sysroots/macos.cpp
Normal file
0
fpc/sysroots/wdk.cpp
Normal file
0
fpc/sysroots/wdk.cpp
Normal file
10
fpc/sysroots/xcode.cpp
Normal file
10
fpc/sysroots/xcode.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "c.h"
|
||||
#include "ld.h"
|
||||
#include "helper.h"
|
||||
#include "sysroots.h"
|
||||
|
||||
DECLARE_SYSROOT_INSTALL_STAGE(xcode_install)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user