blob: f149cbbb89ff4a43376443cd9177062d6db483cf [file] [log] [blame]
Stella Laurenzo1178c122019-10-11 10:43:07 -07001# Required bazel flags for building IREE.
2
Stella Laurenzo1178c122019-10-11 10:43:07 -07003# Disable warnings we don't care about.
4build --copt=-Wno-unused-local-typedef
5
6# C++14 standard version is required.
7build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
8
9# Default to an optimized build.
10# Override via: "-c dbg" or --compilation_mode=dbg
11build --compilation_mode=opt
12
13# Disable visibility checks (works around some private deps in TensorFlow that
14# are being unbundled soon anyway).
15build --nocheck_visibility
16
17# Enable some default cpu flags for x86 optimization.
18build:x86opt --copt=-mavx2
Stella Laurenzoaa854a12019-10-14 10:54:03 -070019
20# Experimental config for building on Windows via clang-cl.
21# As an aspiration, it may eventually not be required to manually
22# activate this config, but for now, it is a place to store the
23# set of flags and tweaks needed to get the Windows build working.
24# Note that this is intended to work with clang-cl, not the Visual
25# Studio compiler. The following must be performed prior to invoking
26# Bazel:
27# * Install Visual Studio Build Tools
28# * export USE_CLANG_CL=1
29# * export BAZEL_LLVM=C:/Users/$USER/scoop/apps/llvm/current
30# (or actual LLVM install location)
31# Then one can build with:
32# bazel build --config=windows {targets...}
33
34# Works around __TIME__ __DATE__, etc redefinitions and -std=c++14
35# warnings.
Stella Laurenzoc941ae42019-10-15 19:06:54 -070036build:windows --copt=-Wno-builtin-macro-redefined --host_copt=-Wno-builtin-macro-redefined
37build:windows --copt=-Wno-unknown-argument --host_copt=-Wno-unknown-argument
Stella Laurenzoaa854a12019-10-14 10:54:03 -070038
39# Disables windows headers from pulling in GDI, which does a lot of terrible
40# things (such as defining the ERROR macro, which breaks the world).
Stella Laurenzoc941ae42019-10-15 19:06:54 -070041build:windows --copt=-DNOGDI --host_copt=-DNOGDI
Stella Laurenzoaa854a12019-10-14 10:54:03 -070042
43# Enables unix-style runfiles link trees (requires symlink permission).
44# See: https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/
45# Generally: Enable Developer Mode in the Developer Settings page of the
46# system settings.
47build:windows --experimental_enable_runfiles
48
Stella Laurenzo7ff35e62019-10-16 12:44:31 -070049# The user.bazelrc file is not checked in but available for local mods.
50# Always keep this at the end of the file so that user flags override.
51try-import user.bazelrc
52