build system revision
[vg.git] / labs / build.c
index bb0b343c8ae4eec5391c7255c2c25f3ce680931b..973f420e3c7ed74e97505eecf1d0a6fcfb7d63aa 100644 (file)
@@ -3,17 +3,15 @@
 
 void s_lab_physics(void){
    vg_info( "running script: s_lab_physics(void)\n" );
-   vg_build.fresh = 0;
-   vg_build.platform = k_platform_linux;
-   vg_build.arch = k_architecture_x86_64;
-   vg_build.compiler = k_compiler_clang;
-   vg_build.libc = k_libc_version_native;
 
-   vg_build_new( "physics" );
-   vg_add_source( "physics.c" );
-   vg_add_graphics();
-   vg_add_game_stuff();
-   vg_compile( "physics" );
+   struct vg_project project;
+   struct vg_env env = vg_test_env;
+
+   vg_project_init( &project, &vg_test_env, "labs" );
+   vg_project_new_target( &project, "physics", k_obj_type_exe );
+   vg_add_engine( &project, NULL );
+   vg_add_source( &project, "physics.c" );
+   vg_compile_project( &project );
    vg_success( "Completed 1/1\n" );
 }
 
@@ -24,11 +22,8 @@ int main( int argc, char *argv[] ){
          s_lab_physics();
 
       if( vg_opt('r') )
-         vg_build.optimization = 3;
+         vg_test_env.optimization = 3;
    }
 
-   if( vg_build.warnings )
-      vg_warn( "Finished with %u warnings\n", vg_build.warnings );
-   else
-      vg_success( "All scripts ran successfully\n" );
+   vg_success( "All scripts ran successfully\n" );
 }