move texture compiler to native code
[carveJwlIkooP6JGAAIwe30JlM.git] / build.c
diff --git a/build.c b/build.c
index 68e485a80a8376aab728044ece7e3c05fd69ee42..94869b4874606405bdc715fbb3078875c2baedd5 100644 (file)
--- a/build.c
+++ b/build.c
@@ -205,11 +205,25 @@ void compile_server( struct vg_project *proj )
    vg_compile_project( proj );
 }
 
+void compile_tools( struct vg_env *env, struct vg_project *proj )
+{
+   struct vg_env backup = *env;
+   env->optimization = 3; /* force optimization always */
+   env->debug_asan = 0;
+
+   vg_project_new_target( proj, "tools/qoi", k_obj_type_shared );
+   vg_add_source( proj, "qoi_lib.c " );
+   vg_compile_project( proj );
+
+   *env = backup;
+}
+
 /*
  * Scripts
  * -------------------------------------------------------------------------- */
 
-void s_release_all(void){
+void s_release_all(void)
+{
    vg_info( "running script: s_release_all(void)\n" );
 
    struct vg_project content_proj, windows_proj, linux_proj;
@@ -224,12 +238,14 @@ void s_release_all(void){
    env.platform = k_platform_windows;
    vg_project_init( &windows_proj, &env, "skaterift" );
    build_game_bin( &windows_proj );
+   compile_tools( &env, &windows_proj );
 
    /* binaries for linux */
    env = vg_release_env;
    env.platform = k_platform_linux;
    vg_project_init( &linux_proj, &env, "skaterift" );
    build_game_bin( &linux_proj );
+   compile_tools( &env, &linux_proj );
 
    /* package them up for storage */
    vg_tarball_project( &content_proj );
@@ -250,6 +266,7 @@ void s_testing_build(void)
    vg_project_init( &test_proj, &vg_test_env, "skaterift-test" );
 
    build_game_bin( &test_proj );
+   compile_tools( &vg_test_env, &test_proj );
    build_game_content( &test_proj );
    vg_add_blob( &test_proj, "steam_appid.txt", "" );
 }