diff --git a/4ed_site.ctm b/4ed_site.ctm index 77ce8a41..1b1c5a2a 100644 Binary files a/4ed_site.ctm and b/4ed_site.ctm differ diff --git a/build.bat b/build.bat index b8fbfe56..0bccd819 100644 --- a/build.bat +++ b/build.bat @@ -19,11 +19,5 @@ popd ..\build\build if %ERRORLEVEL% neq 0 (set FirstError=1) -pushd ..\build -call "print_size.bat" 4coder_custom.dll -call "print_size.bat" 4ed_app.dll -call "print_size.bat" 4ed.exe -popd - :END call "ctime" -end 4ed_data.ctm %FirstError% diff --git a/meta/build.cpp b/meta/build.cpp index 5d9e2dcf..a5161363 100644 --- a/meta/build.cpp +++ b/meta/build.cpp @@ -80,6 +80,7 @@ enum{ OPTIMIZATION = 0x100, KEEP_ASSERT = 0x200, SITE_INCLUDES = 0x400, + X86 = 0x800, }; @@ -136,10 +137,14 @@ init_build_line(Build_Line *line){ #define CL_ICON "..\\res\\icon.res" +#define CL_X86 "-MACHINE:X86" + static void build_cl(u32 flags, char *code_path, char *code_file, char *out_path, char *out_file, char *exports){ Build_Line line; + Build_Line link_line; init_build_line(&line); + init_build_line(&link_line); if (flags & OPTS){ build_ap(line, CL_OPTS); @@ -187,17 +192,26 @@ build_cl(u32 flags, char *code_path, char *code_file, char *out_path, char *out_ swap_ptr(&line.build_options, &line.build_options_prev); - char link_options[1024]; - if (flags & SHARED_CODE){ - assert(exports); - snprintf(link_options, sizeof(link_options), "/OPT:REF %s", exports); - } - else{ - snprintf(link_options, sizeof(link_options), "/NODEFAULTLIB:library"); + if (flags & X86){ + build_ap(link_line, CL_X86); } + if (flags & DEBUG_INFO){ + build_ap(link_line, "/DEBUG "); + } + + char link_type_string[1024]; + if (flags & SHARED_CODE){ + assert(exports); + snprintf(link_type_string, sizeof(link_type_string), "/OPT:REF %s", exports); + } + else{ + snprintf(link_type_string, sizeof(link_type_string), "/NODEFAULTLIB:library"); + } + build_ap(link_line, "%s", link_type_string); + Temp_Dir temp = pushdir(out_path); - systemf("cl %s %s\\%s /Fe%s /link /DEBUG /INCREMENTAL:NO %s", line.build_options, code_path, code_file, out_file, link_options); + systemf("cl %s %s\\%s /Fe%s /link /INCREMENTAL:NO %s", line.build_options, code_path, code_file, out_file, link_line.build_options); popdir(temp); } @@ -629,6 +643,23 @@ int main(int argc, char **argv){ return(error_state); } +#elif defined(DEV_BUILD_X86) + +int main(int argc, char **argv){ + init_time_system(); + + char cdir[256]; + + BEGIN_TIME_SECTION(); + i32 n = get_current_directory(cdir, sizeof(cdir)); + assert(n < sizeof(cdir)); + END_TIME_SECTION("current directory"); + + standard_build(cdir, DEBUG_INFO | SUPER | INTERNAL | X86); + + return(error_state); +} + #elif defined(PACKAGE) int main(int argc, char **argv){ diff --git a/project.4coder b/project.4coder index ed863ed4..9b6abdc0 100644 --- a/project.4coder +++ b/project.4coder @@ -4,6 +4,7 @@ open_recursively=false; fkey_command_win[1] = {"build.bat", "*compilation*", true , true }; fkey_command_win[2] = {"site\\build.bat", "*compilation*", true , true }; fkey_command_win[3] = {"string\\build.bat", "*compilation*", true , true }; +fkey_command_win[4] = {"build.bat /DDEV_BUILD_X86", "*compilation*", true , true }; fkey_command_win[5] = {"..\\misc\\run.bat", "*run*", false, false}; fkey_command_win[12] = {"package.bat", "*package*", false, true }; diff --git a/string/_4coder_string.ctm b/string/_4coder_string.ctm index 97e7ccb8..8a06400b 100644 Binary files a/string/_4coder_string.ctm and b/string/_4coder_string.ctm differ