From 8791fe28a5afae59ebb8a15f68f41284392609e2 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Sun, 9 Jul 2017 15:49:41 -0400 Subject: [PATCH] got string builder working through the primary build.cpp --- build_string.bat | 34 ++++++++++++++++-------------- meta/4ed_build.cpp | 24 ++++++++++++++++++++- string/4coder_string_build_num.txt | 2 +- string/4ed_string_builder.cpp | 2 -- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/build_string.bat b/build_string.bat index d4299d9d..ec550bbf 100644 --- a/build_string.bat +++ b/build_string.bat @@ -1,19 +1,21 @@ @echo off -SET OPTS=-W4 -wd4310 -wd4100 -wd4201 -wd4505 -wd4996 -wd4127 -wd4510 -wd4512 -wd4610 -wd4390 -WX -SET OPTS=%OPTS% -wd4611 -GR- -EHa- -nologo -FC +build.bat /DSTRING_BUILD -SET FirstError=0 - -pushd ..\build -cl %OPTS% ..\code\string\4ed_string_builder.cpp /Zi /Festring_builder -if %ERRORLEVEL% neq 0 (set FirstError=1) -if %ERRORLEVEL% neq 0 (goto END) -popd - -pushd string -..\..\build\string_builder -if %ERRORLEVEL% neq 0 (set FirstError=1) -popd - -:END +REM SET OPTS=-W4 -wd4310 -wd4100 -wd4201 -wd4505 -wd4996 -wd4127 -wd4510 -wd4512 -wd4610 -wd4390 -WX +REM SET OPTS=%OPTS% -wd4611 -GR- -EHa- -nologo -FC +REM +REM SET FirstError=0 +REM +REM pushd ..\build +REM cl %OPTS% ..\code\string\4ed_string_builder.cpp /Zi /Festring_builder +REM if %ERRORLEVEL% neq 0 (set FirstError=1) +REM if %ERRORLEVEL% neq 0 (goto END) +REM popd +REM +REM pushd string +REM ..\..\build\string_builder +REM if %ERRORLEVEL% neq 0 (set FirstError=1) +REM popd +REM +REM :END diff --git a/meta/4ed_build.cpp b/meta/4ed_build.cpp index 846c1c1c..6dc29981 100644 --- a/meta/4ed_build.cpp +++ b/meta/4ed_build.cpp @@ -430,7 +430,7 @@ site_build(char *cdir, u32 flags){ END_TIME_SECTION("build sitegen"); } - { + if (prev_error == 0){ BEGIN_TIME_SECTION(); char *cmd = fm_str(BUILD_DIR"/sitegen"); char *code_dir = fm_str("."); @@ -472,6 +472,25 @@ metagen(char *cdir){ 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 do_buildsuper(char *cdir, char *file, u32 arch){ BEGIN_TIME_SECTION(); @@ -668,6 +687,9 @@ int main(int argc, char **argv){ #elif defined(SITE_BUILD) site_build(cdir, DEBUG_INFO); +#elif defined(STRING_BUILD) + string_build(cdir); + #else # error No build type specified. #endif diff --git a/string/4coder_string_build_num.txt b/string/4coder_string_build_num.txt index f92a4013..89534ae9 100644 --- a/string/4coder_string_build_num.txt +++ b/string/4coder_string_build_num.txt @@ -1,5 +1,5 @@ 1 0 -88 +91 diff --git a/string/4ed_string_builder.cpp b/string/4ed_string_builder.cpp index 3c1e5d9b..1947dc5a 100644 --- a/string/4ed_string_builder.cpp +++ b/string/4ed_string_builder.cpp @@ -281,8 +281,6 @@ int main(){ Item_Node *item = string_unit.set.items + j; if (item->t == Item_Function){ - //append_ss (&line, item->marker); - //append_padding (&line, ' ', RETURN_PADDING); append_ss (&line, item->ret); append_padding (&line, ' ', SIG_PADDING); append_ss (&line, item->name);