Skip to content

Windows Cross Build using Clang

WangBin edited this page Mar 19, 2020 · 5 revisions

Supported host Platforms:

  • Windows
  • Linux
  • macOS
  • Any platforms can run clang

Requirements:

  • llvm tools: clang, lld, llvm-nm, llvm-ar etc.
  • vcrt and windows sdk
  • lower case symbolic links on case sensitive filesystems: run ./winsdk/lowercase.sh

Environment Variables:

  • ONECORE: "onecore" or empty/unset
  • USE_TOOLCHAIN: clang path, or simply clang(on macOS, it's xcode'c clang)

Command: USE_TOOLCHAIN=clang-10 ./avbuild.sh win "arch1 arch2 ...", arch1/arch2 can be x86, x64 etc. If arch is not set, i.e. USE_TOOLCHAIN=clang-10 ./avbuild.sh win, then x86 and x64 will be built at the same time.

USE_TOOLCHAIN=clang-10 ./avbuild.sh uwp|winrt|winstore: build for uwp

Miscs:

TODO:

  • win[version][store]: min target windows version, e.g. win5.1 for xp, win6.0 for vista, win10store for uwp