From 46664047a1a779bab2cd4ffdb2cadf8215690fbe Mon Sep 17 00:00:00 2001 From: bumbread Date: Thu, 21 Jul 2022 16:45:12 +1100 Subject: [PATCH] faster build lmao --- bake.cmd | 2 ++ bake.py | 2 +- src/code/fmt/gen_fmt.h | 1 - src/code/math/basic.c | 4 ++++ src/unity.c | 31 +++++++++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 bake.cmd create mode 100644 src/unity.c diff --git a/bake.cmd b/bake.cmd new file mode 100644 index 0000000..4847823 --- /dev/null +++ b/bake.cmd @@ -0,0 +1,2 @@ + +clang src\unity.c -o ciabatta.lib -c -I inc -I fdec64 -I unicope\inc -I src\win -nodefaultlibs -g -mfma diff --git a/bake.py b/bake.py index afb94f6..a304d41 100644 --- a/bake.py +++ b/bake.py @@ -88,8 +88,8 @@ def clang_compile(file_name): cmn_flags = clang_common_flags flags = dbg_flags + cmn_flags + inc_flags + def_flags command = ' '.join(["clang", file_name, '-o', bin_path] + flags) + print('$ ', command) subprocess.run(command.split(' ')) - print(file_name, '=>', bin_path) def nasm_compile(file_name): bin_path = get_bin_path(file_name) diff --git a/src/code/fmt/gen_fmt.h b/src/code/fmt/gen_fmt.h index c86976b..1cc5830 100644 --- a/src/code/fmt/gen_fmt.h +++ b/src/code/fmt/gen_fmt.h @@ -1,6 +1,5 @@ #include -#include #include #include #include diff --git a/src/code/math/basic.c b/src/code/math/basic.c index 1719ef7..aedf01a 100644 --- a/src/code/math/basic.c +++ b/src/code/math/basic.c @@ -6,6 +6,10 @@ #error "Get a better CPU (the kind that supports FMA) or enable -mfma" #endif +// xmmintrin.h depends on mm_malloc.h, which itself includes other CRT headers +// Which introduces compiler errors. Actually does it really matter? I would +// need to check again +#undef __STDC_HOSTED__ #include #include diff --git a/src/unity.c b/src/unity.c new file mode 100644 index 0000000..dae3223 --- /dev/null +++ b/src/unity.c @@ -0,0 +1,31 @@ + +// clang src\unity.c -o ciabatta.lib -c -I inc -I fdec64 -I unicope\inc -I src\win -nodefaultlibs -g -mfma -U__STDC_HOSTED__ + +// Platform-independent stuff +#include "code/fmt/gen_fmt.c" +#include "code/math/basic.c" +#include "code/math/division.c" +#include "code/math/gen_math.c" +#include "code/math/ieee754.c" +#include "code/math/round.c" +#include "code/stdlib/algorithm.c" +#include "code/stdlib/conversion.c" +#include "code/stdlib/multibyte.c" +#include "code/stdlib/random.c" +#include "code/ctype.c" +#include "code/errno.c" +#include "code/fenv.c" +#include "code/locale.c" +#include "code/string.c" +#include "code/uchar.c" +#include "code/wctype.c" + +// Windows stuff +#include "win/win_assert.c" +#include "win/win_environment.c" +#include "win/win_heap.c" +#include "win/win_signal.c" +#include "win/win_stack_trace.c" +#include "win/win_stdio.c" +#include "win/win_threads.c" +#include "win/win_time.c"