From 0a7b7d0d609ad78777d086118c878af9d4caea29 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 7 Jul 2017 23:38:29 -0400 Subject: [PATCH] got build working on Mac, doing more cleanup --- meta/4ed_file_moving.h | 42 +++++++++++++++++++++++++++++++++++++----- meta/build.cpp | 36 ++---------------------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/meta/4ed_file_moving.h b/meta/4ed_file_moving.h index ec718114..6635136f 100644 --- a/meta/4ed_file_moving.h +++ b/meta/4ed_file_moving.h @@ -93,6 +93,39 @@ static char platform_correct_slash = '/'; #error Slash not set for this platform. #endif +// File Extensions +#if defined(IS_WINDOWS) +#define EXE ".exe" +#elif defined(IS_LINUX) || defined(IS_MAC) +#define EXE "" +#else +#error No EXE format specified for this OS +#endif + +#if defined(IS_WINDOWS) +#define PDB ".pdb" +#elif defined(IS_LINUX) || defined(IS_MAC) +#define PDB "" +#else +#error No PDB format specified for this OS +#endif + +#if defined(IS_WINDOWS) +#define DLL ".dll" +#elif defined(IS_LINUX) || defined(IS_MAC) +#define DLL ".so" +#else +#error No DLL format specified for this OS +#endif + +#if defined(IS_WINDOWS) +#define BAT ".bat" +#elif defined(IS_LINUX) || defined(IS_MAC) +#define BAT ".sh" +#else +#error No BAT format specified for this OS +#endif + #endif // @@ -349,7 +382,7 @@ fm_popdir(Temp_Dir temp){ } static void -fm_init_time_system(){ +fm_init_system(){ // NOTE(allen): do nothing } @@ -378,12 +411,12 @@ fm_execute_in_dir(char *dir, char *str, char *args){ if (args){ Temp_Dir temp = fm_pushdir(dir); systemf("%s %s", str, args); - popdir(temp); + fm_popdir(temp); } else{ Temp_Dir temp = fm_pushdir(dir); systemf("%s", str); - popdir(temp); + fm_popdir(temp); } } else{ @@ -458,8 +491,7 @@ fm_zip(char *parent, char *folder, char *file){ Temp_Dir temp = fm_pushdir(parent); printf("PARENT DIR: %s\n", parent); systemf("zip -r %s %s", file, folder); - - popdir(temp); + fm_popdir(temp); } #else diff --git a/meta/build.cpp b/meta/build.cpp index 223fcdea..9cbdb35f 100644 --- a/meta/build.cpp +++ b/meta/build.cpp @@ -21,38 +21,6 @@ // reusable // -#if defined(IS_WINDOWS) -#define EXE ".exe" -#elif defined(IS_LINUX) || defined(IS_MAC) -#define EXE "" -#else -#error No EXE format specified for this OS -#endif - -#if defined(IS_WINDOWS) -#define PDB ".pdb" -#elif defined(IS_LINUX) || defined(IS_MAC) -#define PDB "" -#else -#error No PDB format specified for this OS -#endif - -#if defined(IS_WINDOWS) -#define DLL ".dll" -#elif defined(IS_LINUX) || defined(IS_MAC) -#define DLL ".so" -#else -#error No DLL format specified for this OS -#endif - -#if defined(IS_WINDOWS) -#define BAT ".bat" -#elif defined(IS_LINUX) || defined(IS_MAC) -#define BAT ".sh" -#else -#error No BAT format specified for this OS -#endif - static void swap_ptr(char **A, char **B){ char *a = *A; @@ -431,9 +399,9 @@ build(u32 flags, char *code_path, char **code_files, char *out_path, char *out_f swap_ptr(&line.build_options, &line.build_options_prev); - Temp_Dir temp = pushdir(out_path); + Temp_Dir temp = fm_pushdir(out_path); systemf("g++ %s -o %s", line.build_options, out_file); - popdir(temp); + fm_popdir(temp); } #else