cleaner steamworks switches
[vg.git] / vg_compiler.sh
index fec59b9250dd1cebdc91d73954ac0df17beec29d..49a12fd47c765e8cefe4a3f4fb0be05739dbf258 100755 (executable)
@@ -12,6 +12,7 @@ opt_linux=false
 opt_windows=false
 opt_tools=false
 opt_full=false
+opt_gcc=""
 opt_steam=""
 
 # Util
@@ -66,7 +67,7 @@ target_os_windows(){
 target_os_linux(){
    target_ext=""
    target_compiler="gcc"
-   target_libs="-lGL -lglfw -lX11 -lXxf86vm -lXrandr -lm -lpthread -lXi -ldl"
+   target_libs="-lGL -lglfw -lX11 -lXxf86vm -lXrandr -lm -lpthread -lXi -ldl -lsteam_api"
    target_dir="build.linux"
    target_steam_api="libsteam_api.so"
    if [ $opt_release = true ]; then
@@ -77,8 +78,8 @@ target_os_linux(){
 }
 
 compile_x(){
-   paths="-I. -L$vg_root/dep/glfw -I$vg_root/dep -I$vg_root/src"
-   setup="$target_compiler -Wall -Wstrict-aliasing=3 -Wno-unused-function $paths"
+   paths="-I. -L$vg_root/dep/glfw -L$vg_root/dep/steam -I$vg_root/dep -I$vg_root/src"
+   setup="$target_compiler $opt_gcc -Wall -Wstrict-aliasing=3 -Wno-unused-function $paths"
    targets="$1 $vg_root/dep/glad/glad.c -o $2$target_ext"
    final="$target_libs -Wl,-rpath=./ $opt_steam"
    cmd="$setup $target_opts $targets $final"
@@ -177,7 +178,7 @@ else
    target_os_linux
 fi
 
-options=rptlwa
+options=rptlwaq
 longopts=release,build-linux,build-windows,steam,play,build-tools,assets,full
 parsed=$(getopt --options=$options --longoptions=$longopts --name "vgc" -- "$@")
 
@@ -189,6 +190,10 @@ fi
 eval set -- "$parsed"
 while true; do
    case "$1" in
+      -q)
+         opt_gcc=""
+         shift;
+         ;;
       -a|--assets)
          opt_assets=true
          shift;