got string builder working through the primary build.cpp

This commit is contained in:
Allen Webster 2017-07-09 15:49:41 -04:00
parent 39a56b2aa9
commit 8791fe28a5
4 changed files with 42 additions and 20 deletions

View File

@ -1,19 +1,21 @@
@echo off @echo off
SET OPTS=-W4 -wd4310 -wd4100 -wd4201 -wd4505 -wd4996 -wd4127 -wd4510 -wd4512 -wd4610 -wd4390 -WX build.bat /DSTRING_BUILD
SET OPTS=%OPTS% -wd4611 -GR- -EHa- -nologo -FC
SET FirstError=0 REM SET OPTS=-W4 -wd4310 -wd4100 -wd4201 -wd4505 -wd4996 -wd4127 -wd4510 -wd4512 -wd4610 -wd4390 -WX
REM SET OPTS=%OPTS% -wd4611 -GR- -EHa- -nologo -FC
pushd ..\build REM
cl %OPTS% ..\code\string\4ed_string_builder.cpp /Zi /Festring_builder REM SET FirstError=0
if %ERRORLEVEL% neq 0 (set FirstError=1) REM
if %ERRORLEVEL% neq 0 (goto END) REM pushd ..\build
popd REM cl %OPTS% ..\code\string\4ed_string_builder.cpp /Zi /Festring_builder
REM if %ERRORLEVEL% neq 0 (set FirstError=1)
pushd string REM if %ERRORLEVEL% neq 0 (goto END)
..\..\build\string_builder REM popd
if %ERRORLEVEL% neq 0 (set FirstError=1) REM
popd REM pushd string
REM ..\..\build\string_builder
:END REM if %ERRORLEVEL% neq 0 (set FirstError=1)
REM popd
REM
REM :END

View File

@ -430,7 +430,7 @@ site_build(char *cdir, u32 flags){
END_TIME_SECTION("build sitegen"); END_TIME_SECTION("build sitegen");
} }
{ if (prev_error == 0){
BEGIN_TIME_SECTION(); BEGIN_TIME_SECTION();
char *cmd = fm_str(BUILD_DIR"/sitegen"); char *cmd = fm_str(BUILD_DIR"/sitegen");
char *code_dir = fm_str("."); char *code_dir = fm_str(".");
@ -472,6 +472,25 @@ metagen(char *cdir){
build_and_run(cdir, "meta/4ed_metagen.cpp", "metagen", OPTS | DEBUG_INFO); build_and_run(cdir, "meta/4ed_metagen.cpp", "metagen", OPTS | DEBUG_INFO);
} }
internal void
string_build(char *cdir){
char *dir = fm_str(BUILD_DIR);
{
char *file = fm_str("string/4ed_string_builder.cpp");
BEGIN_TIME_SECTION();
build(OPTS | DEBUG_INFO, Arch_X64, cdir, file, dir, "string_builder", 0, 0, includes);
END_TIME_SECTION("build string_builder");
}
if (prev_error == 0){
char *cmd = fm_str(cdir, "/", dir, "/string_builder");
BEGIN_TIME_SECTION();
fm_execute_in_dir(fm_str(cdir, "/string"), cmd, 0);
END_TIME_SECTION("run string_builder");
}
}
internal void internal void
do_buildsuper(char *cdir, char *file, u32 arch){ do_buildsuper(char *cdir, char *file, u32 arch){
BEGIN_TIME_SECTION(); BEGIN_TIME_SECTION();
@ -668,6 +687,9 @@ int main(int argc, char **argv){
#elif defined(SITE_BUILD) #elif defined(SITE_BUILD)
site_build(cdir, DEBUG_INFO); site_build(cdir, DEBUG_INFO);
#elif defined(STRING_BUILD)
string_build(cdir);
#else #else
# error No build type specified. # error No build type specified.
#endif #endif

View File

@ -1,5 +1,5 @@
1 1
0 0
88 91

View File

@ -281,8 +281,6 @@ int main(){
Item_Node *item = string_unit.set.items + j; Item_Node *item = string_unit.set.items + j;
if (item->t == Item_Function){ if (item->t == Item_Function){
//append_ss (&line, item->marker);
//append_padding (&line, ' ', RETURN_PADDING);
append_ss (&line, item->ret); append_ss (&line, item->ret);
append_padding (&line, ' ', SIG_PADDING); append_padding (&line, ' ', SIG_PADDING);
append_ss (&line, item->name); append_ss (&line, item->name);