export PREFIX=$HOME/toolchains/x86_64-w64-mingw32-mcf/x86_64-w64-mingw32
export PATH=$PREFIX/bin:$PATH
cmake ../../../llvm-project/llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_AR="$HOME/llvm_toolchains/native/bin/llvm-ar" -DCMAKE_LINKER="$HOME/llvm_toolchains/native/bin/llvm-ld" -DCMAKE_NM="$HOME/llvm_toolchains/native/bin/llvm-nm" -DCMAKE_OBJDUMP="$HOME/llvm_toolchains/native/bin/llvm-objdump" -DCMAKE_RANLIB="$HOME/llvm_toolchains/native/bin/llvm-ranlib" -DCMAKE_DLLTOOL="$HOME/llvm_toolchains/native/bin/llvm-dlltool" -DLLVM_USE_LINKER=lld -DCMAKE_C_COMPILER_TARGET=x86_64-w64-mingw32 -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" -DLLVM_ENABLE_RUNTIMES="compiler-rt" -DCMAKE_SYSROOT=$PREFIX -Wno-dev -DLLVM_INCLUDE_TESTS=Off -DLLVM_INCLUDE_EXAMPLES=Off -DLLVM_ENABLE_BACKTRACES=Off  -DLLVM_ENABLE_PIC=Off -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-windows-gnu -DLLVM_HOST_TRIPLE=x86_64-windows-gnu -DHAVE_CXX_FLAG_WTHREAD_SAFETY=Off -DLLVM_TABLEGEN=$HOME/llvm_toolchains/native/bin/llvm-tblgen -DCLANG_TABLEGEN=$HOME/llvm_toolchains/native/bin/clang-tblgen -DCMAKE_CROSSCOMPILING=On -DCMAKE_HOST_SYSTEM_NAME=Windows -DCMAKE_INSTALL_PREFIX=$HOME/toolchains/llvm/x86_64-windows-gnu/llvm -DCMAKE_SYSTEM_NAME=Windows -GNinja -DLLVM_ENABLE_ZLIB=FORCE_ON -DWIN32=1 -DMINGW=1 -DZLIB_LIBRARY=$PREFIX/x86_64-w64-mingw32/lib/libzlibstatic.a -DZLIB_INCLUDE_DIR=$PREFIX/x86_64-w64-mingw32/include -DHAVE_ZLIB=On -DLLVM_OPTIMIZED_TABLEGEN=On -DLLVM_ENABLE_ASSERTIONS=Off -DLLVM_ENABLE_UNWIND_TABLES=Off -DCMAKE_CXX_COMPILER_TARGET=x86_64-w64-mingw32 -DBUILD_SHARED_LIBS=On -DLLVM_ENABLE_LTO=thin