some improvements i think
This commit is contained in:
45
asmrigs/build.cpp
Normal file
45
asmrigs/build.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "c.h"
|
||||
#include "ld.h"
|
||||
#include "helper.h"
|
||||
|
||||
ADD_DEPENDENCY_BUILD_FILE(tier0, "../tier0/build.cpp")
|
||||
ADD_DEPENDENCY_BUILD_FILE(tier1, "../tier1/build.cpp")
|
||||
ADD_DEPENDENCY_BUILD_FILE(tier2, "../tier2/build.cpp")
|
||||
ADD_DEPENDENCY_BUILD_FILE(fs, "../stdfilesystems/build.cpp")
|
||||
|
||||
DECLARE_BUILD_STAGE(brb)
|
||||
{
|
||||
CProject_t stProject = {};
|
||||
LinkProject_t stLink = {};
|
||||
CUtlString szBuiltFile = {};
|
||||
|
||||
stProject.m_szName = "bc";
|
||||
stProject.files = {
|
||||
"brb/lexer.cpp",
|
||||
"brb/main.cpp",
|
||||
};
|
||||
stProject.includeDirectories = {
|
||||
"../public"
|
||||
};
|
||||
|
||||
stLink = ccompiler->Compile(&stProject);
|
||||
stLink.libraryObjects = {
|
||||
GET_PROJECT_LIBRARY(tier0, "tier0"),
|
||||
GET_PROJECT_LIBRARY(tier1, "tier1"),
|
||||
GET_PROJECT_LIBRARY(tier2, "tier2"),
|
||||
};
|
||||
szBuiltFile = linker->Link(&stLink);
|
||||
ADD_OUTPUT_OBJECT("bc", szBuiltFile);
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
DECLARE_BUILD_STAGE(brb_install)
|
||||
{
|
||||
CUtlString szBuildOutput = CUtlString("build/%s", Target_t::DefaultTarget().GetTriplet().GetString());
|
||||
filesystem2->MakeDirectory(szBuildOutput);
|
||||
filesystem2->CopyFile(szBuildOutput, GET_PROJECT_OBJECT(brb, "bc"));
|
||||
filesystem2->CopyFile(szBuildOutput, GET_PROJECT_LIBRARY(tier0, "tier0"));
|
||||
filesystem2->CopyFile(szBuildOutput, GET_PROJECT_LIBRARY(filesystem_std, "fs"));
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user