Stella Laurenzo | 1178c12 | 2019-10-11 10:43:07 -0700 | [diff] [blame] | 1 | # Required bazel flags for building IREE. |
| 2 | |
Stella Laurenzo | 1178c12 | 2019-10-11 10:43:07 -0700 | [diff] [blame] | 3 | # Disable warnings we don't care about. |
| 4 | build --copt=-Wno-unused-local-typedef |
| 5 | |
| 6 | # C++14 standard version is required. |
| 7 | build --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 |
| 11 | build --compilation_mode=opt |
| 12 | |
| 13 | # Disable visibility checks (works around some private deps in TensorFlow that |
| 14 | # are being unbundled soon anyway). |
| 15 | build --nocheck_visibility |
| 16 | |
| 17 | # Enable some default cpu flags for x86 optimization. |
| 18 | build:x86opt --copt=-mavx2 |
Stella Laurenzo | aa854a1 | 2019-10-14 10:54:03 -0700 | [diff] [blame] | 19 | |
| 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 Laurenzo | c941ae4 | 2019-10-15 19:06:54 -0700 | [diff] [blame] | 36 | build:windows --copt=-Wno-builtin-macro-redefined --host_copt=-Wno-builtin-macro-redefined |
| 37 | build:windows --copt=-Wno-unknown-argument --host_copt=-Wno-unknown-argument |
Stella Laurenzo | aa854a1 | 2019-10-14 10:54:03 -0700 | [diff] [blame] | 38 | |
| 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 Laurenzo | c941ae4 | 2019-10-15 19:06:54 -0700 | [diff] [blame] | 41 | build:windows --copt=-DNOGDI --host_copt=-DNOGDI |
Stella Laurenzo | aa854a1 | 2019-10-14 10:54:03 -0700 | [diff] [blame] | 42 | |
| 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. |
| 47 | build:windows --experimental_enable_runfiles |
| 48 | |
Stella Laurenzo | 7ff35e6 | 2019-10-16 12:44:31 -0700 | [diff] [blame^] | 49 | # 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. |
| 51 | try-import user.bazelrc |
| 52 | |