2 #include "vg/vg_platform.h"
5 #include "vg/vg_build.h"
6 #include "vg/vg_build_utils_shader.h"
9 u32 optimize_test_compile
= 0;
12 * Compilation specifications
13 * -------------------------------------------------------------------------- */
15 void build_game_content(void){
16 const char *project_name
= vg_build
.project_name
.buffer
;
17 vg_low( "Building game content structure\n" );
18 vg_symlink( "textures", "textures" );
19 vg_syscall( "mkdir -p bin/%s/cfg", project_name
);
22 void build_shaders(void);
23 void compile_game( int binaries
, int content
){
31 vg_build_new( "marblecomp" );
34 vg_add_source( "marblecomp.c" );
37 vg_compile( "marblecomp" );
46 * -------------------------------------------------------------------------- */
48 void s_release_all(void){
49 vg_info( "running script: s_release_all(void)\n" );
51 vg_build
.optimization
= 3;
53 vg_build
.arch
= k_architecture_x86_64
;
54 vg_build
.compiler
= k_compiler_zigcc
;
55 vg_build
.libc
= k_libc_version_2_23
;
57 /* binaries for windows and linux */
58 vg_build
.platform
= k_platform_windows
;
60 vg_tarball_last_project();
61 vg_success( "Completed 1/3\n" );
63 vg_build
.platform
= k_platform_linux
;
65 vg_tarball_last_project();
66 vg_success( "Completed 2/3\n" );
68 /* content files for any platform */
69 vg_build
.platform
= k_platform_anyplatform
;
70 vg_build
.compiler
= k_compiler_blob
;
71 vg_build
.arch
= k_architecture_anyarch
;
72 vg_build
.libc
= k_libc_version_native
;
74 vg_tarball_last_project();
75 vg_success( "Completed 3/3\n" );
78 void s_testing_build(void){
79 vg_info( "running script: s_testing_build(void)\n" );
81 vg_build
.optimization
= optimize_test_compile
;
83 vg_build
.platform
= k_platform_linux
;
84 vg_build
.arch
= k_architecture_x86_64
;
85 vg_build
.compiler
= k_compiler_clang
;
86 vg_build
.libc
= k_libc_version_native
;
90 vg_success( "Completed 1/1\n" );
93 int main( int argc
, char *argv
[] ){
95 while( vg_argp( argc
, argv
) ){
96 if( vg_long_opt( "release-all" ) )
99 if( vg_long_opt( "testing-build" ) )
103 optimize_test_compile
= 3;
106 if( vg_build
.warnings
)
107 vg_warn( "Finished with %u warnings\n", vg_build
.warnings
);
109 vg_success( "All scripts ran successfully\n" );
112 #define _S( NAME, VS, FS ) \
113 vg_build_shader( "shaders/" VS, "shaders/" FS, NULL, "shaders", NAME )
115 void build_shaders(void){
116 vg_info( "Compiling shader headers\n" );
117 vg_shader_set_include_dir( "shaders" );
120 //_S( "scene_standard", "scene.vs", "scene_standard.fs" );