faster build lmao

This commit is contained in:
bumbread 2022-07-21 16:45:12 +11:00
parent 5e0d4ae8b7
commit 46664047a1
5 changed files with 38 additions and 2 deletions

2
bake.cmd Normal file
View File

@ -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

View File

@ -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)

View File

@ -1,6 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <limits.h>
#include <string.h>

View File

@ -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 <immintrin.h>
#include <xmmintrin.h>

31
src/unity.c Normal file
View File

@ -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"