#!/bin/bash -x

#
# VS 2019 build script
#

#source vs2019.env

O=-O1

cl -nologo -MD -W3 -O1 gen_csv.c

cl -nologo -MD -W3 $O -EHsc test_hans.cpp

cl -nologo -MD -W3 $O test_foobar2.c
#cl -nologo -W3 $O test_foobar3.c memcpy64.obj strcmp64.obj strlen64.obj -link -map

#x86_64-w64-mingw32-gcc.exe $O -o test_foobar2_mingw.exe test_foobar2.c

cl -nologo -MD -W3 $O test_foobar3.c
#cl -nologo -W3 $O test_foobar3.c memcpy64.obj strcmp64.obj strlen64.obj -link -map

cl -nologo -MD -W3 $O -std:c++17 -EHsc test_heinzel.cpp

cl -nologo -MD -W3 $O -std:c++17 -EHsc test_heinzel2.cpp

#x86_64-w64-mingw32-g++.exe -std=c++17 $O -o test_heinzel2_mingw.exe test_heinzel2.cpp

cl -nologo -DUSE_HASH -W3 $O -Oi- -GS- -Zl test_native_hash.c winobj.lib \
    -link -release -nodefaultlib -entry:start -subsystem:console -map kernel32.lib

cl -nologo -W3 $O -Oi- -GS- -Zl -Fetest_native_n2.exe test_native_hash.c winobj.lib \
    -link -release -nodefaultlib -entry:start -subsystem:console -map kernel32.lib

rustc.exe -O test_jemand_rust.rs

cl -nologo -MD -W3 $O -EHsc test_mikro77_hash.cpp
cl -nologo -MD -W3 $O -EHsc test_mikro77_sort.cpp
cl -nologo -MD -W3 $O -EHsc test_mikro77_n2.cpp

cl -nologo -W3 -EHsc $O -std:c++latest test_roger.cpp

strip *.exe
rm -f test*.obj

size test*.exe
