Setup build.cpp to handle multiple build files on a single line

This commit is contained in:
Allen Webster 2017-06-29 21:18:44 -04:00
parent d652cb46af
commit 8fc0420306
1 changed files with 21 additions and 5 deletions

View File

@ -290,7 +290,7 @@ build(u32 flags, char *code_path, char *code_file, char *out_path, char *out_fil
#define GCC_SITE_INCLUDES "-I../../foreign -I../../code" #define GCC_SITE_INCLUDES "-I../../foreign -I../../code"
static void static void
build(u32 flags, char *code_path, char *code_file, char *out_path, char *out_file, char *exports, char *inc_flags){ build(u32 flags, char *code_path, char **code_files, char *out_path, char *out_file, char *exports, char *inc_flags){
Build_Line line; Build_Line line;
init_build_line(&line); init_build_line(&line);
@ -360,7 +360,9 @@ build(u32 flags, char *code_path, char *code_file, char *out_path, char *out_fil
} }
build_ap(line, "-I\"%s\"", code_path); build_ap(line, "-I\"%s\"", code_path);
build_ap(line, "\"%s/%s\"", code_path, code_file); for (u32 i = 0; code_files[i] != 0; ++i){
build_ap(line, "\"%s/%s\"", code_path, code_files[i]);
}
if (flags & LIBS){ if (flags & LIBS){
build_ap(line, GCC_LIBS); build_ap(line, GCC_LIBS);
@ -377,6 +379,15 @@ build(u32 flags, char *code_path, char *code_file, char *out_path, char *out_fil
# error build function not defined for this compiler # error build function not defined for this compiler
#endif #endif
static void
build(u32 flags, char *code_path, char *code_file, char *out_path, char *out_file, char *exports, char *inc_flags){
char *code_files[2];
code_files[0] = code_file;
code_files[1] = 0;
build(flags, code_path, code_files, out_path, out_file, exports, inc_flags);
}
static void static void
buildsuper(char *code_path, char *out_path, char *filename, b32 x86_build){ buildsuper(char *code_path, char *out_path, char *filename, b32 x86_build){
Temp_Dir temp = pushdir(out_path); Temp_Dir temp = pushdir(out_path);
@ -404,7 +415,7 @@ buildsuper(char *code_path, char *out_path, char *filename, b32 x86_build){
#if defined(IS_WINDOWS) #if defined(IS_WINDOWS)
# define PLAT_LAYER "win32_4ed.cpp" char *PLAT_LAYER[] = { "win32_4ed.cpp", 0 };
# if defined(IS_CL) # if defined(IS_CL)
# define PLAT_INC "/I..\\code\\platform_all" # define PLAT_INC "/I..\\code\\platform_all"
# else # else
@ -413,7 +424,7 @@ buildsuper(char *code_path, char *out_path, char *filename, b32 x86_build){
#elif defined(IS_LINUX) #elif defined(IS_LINUX)
# define PLAT_LAYER "platform_linux/linux_4ed.cpp" char *PLAT_LAYER[] = { "platform_linux/linux_4ed.cpp", 0 };
# if defined(IS_GCC) # if defined(IS_GCC)
# define PLAT_INC "-I../code/platform_all -I../code/platform_unix" # define PLAT_INC "-I../code/platform_all -I../code/platform_unix"
# else # else
@ -422,7 +433,12 @@ buildsuper(char *code_path, char *out_path, char *filename, b32 x86_build){
#elif defined(IS_MAC) #elif defined(IS_MAC)
# define PLAT_LAYER "platform_mac/mac_4ed.m platform_mac/mac_4ed.cpp" char *PLAT_LAYER[] = {
"platform_mac/mac_4ed.m",
"platform_mac/mac_4ed.cpp",
0
};
# if defined(IS_GCC) # if defined(IS_GCC)
# define PLAT_INC "-I../code/platform_all -I../code/platform_unix" # define PLAT_INC "-I../code/platform_all -I../code/platform_unix"
# else # else