aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/cpp/windows_cc_configure.bzl
Commit message (Collapse)AuthorAge
* Automated rollback of commit 2aeaeba66857c561dd6d63c79a213f1cabc3650d.Gravatar dslomov2018-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks C++ on gcc 4.8.4 (specifically, TensorFlow: https://github.com/bazelbuild/bazel/issues/4474) Fixes #4474 *** Original change description *** When linking mostly-static Linux binaries, link libstdc++.a explicitly. This allows libstdc++ to be statically linked, which is normally only possible when invoking GCC as `g++` with the `-static-libstdc++` flag. Fixes https://github.com/bazelbuild/bazel/issues/2840 See https://github.com/envoyproxy/envoy/issues/415 for additional background and context. cc @htuch (for Envoy) and @calpeyser @hlopko (who I talked to earlier about this)... *** RELNOTES: None. PiperOrigin-RevId: 182519445
* Refactor Windows C++ toolchain selectionGravatar Yun Peng2018-01-03
| | | | | | | | | | | | | | | | | | | We used to have --cpu=x64_windows_msys for selecting msys gcc toolchain, this is a misuse of --cpu flag. Instead, we should use --compiler flag to select C++ toolchain. For example, --compiler=msvc-cl, --compiler=msys-gcc, --compiler=mingw-gcc After this change, we can use mingw gcc toolchain by following steps: 1. In MSYS, install mingw by `pacman -S mingw-w64-x86_64-gcc` 2. Add /mingw64:/mingw64/bin into PATH 3. build with --compiler=mingw-gcc Related: https://github.com/bazelbuild/rules_go/issues/736 Change-Id: I4b5f77ce0698cfcafefe5d2ab17657f9c9e295d3 PiperOrigin-RevId: 180678829
* Windows MSYS CROSSTOOL: Remove /usr from cxx_builtin_include_directoryGravatar Yun Peng2017-12-20
| | | | | | | | | | After 8b3ba50246fed6ff13d70299fb039cc66be465c4, msys path should not appear in CROSSTOOL, because Bazel won't translate it anymore. Fix https://github.com/bazelbuild/bazel/issues/4318 Change-Id: I33d783a2ef14299e586856fefa2d68adce587045 PiperOrigin-RevId: 179667545
* Fix windows_cc_configure after ↵Gravatar hlopko2017-12-13
| | | | | | | | | https://github.com/bazelbuild/bazel/commit/2aeaeba66857c561dd6d63c79a213f1cabc3650d Fixes #4288 RELNOTES: None. PiperOrigin-RevId: 178889458
* When linking mostly-static Linux binaries, link libstdc++.a explicitly.Gravatar John Millikin2017-12-12
| | | | | | | | | | | | | | | | | | This allows libstdc++ to be statically linked, which is normally only possible when invoking GCC as `g++` with the `-static-libstdc++` flag. Fixes https://github.com/bazelbuild/bazel/issues/2840 See https://github.com/envoyproxy/envoy/issues/415 for additional background and context. cc @htuch (for Envoy) and @calpeyser @hlopko (who I talked to earlier about this) I'm only doing this in the Linux toolchain because MacOS doesn't do static linking of system libs anyway, and I don't know enough about Windows or FreeBSD to test on those platforms. Closes #4031. PiperOrigin-RevId: 178762357
* Windows MSVC CROSSTOOL: Don't pass /DEBUG:FASTLINK to linker if it doesn't ↵Gravatar Yun Peng2017-12-11
| | | | | | | | | | | | | | support it This makes Bazel work nicer with VC++ version prior to VC++ 2015, but it doesn't mean we fully support them. For example, /WHOLEARCHIVE doesn't work with versions older that VC++ 2015, either. Fixed https://github.com/bazelbuild/bazel/issues/3109 Fixed https://github.com/bazelbuild/bazel/issues/4240 Change-Id: Iab7280bea241a203cb04dc9ca0a7b3bce518fb64 PiperOrigin-RevId: 178615516
* Windows: Expose find_vc_path and find_msvc_tool functionGravatar Yun Peng2017-12-01
| | | | | | | | | | | | | | | find_vc_path and find_msvc_tool are now visible from windows_cc_configure.bzl, users can do: load("@bazel_tools//tools/cpp:windows_cc_configure.bzl", "find_vc_path" "find_msvc_tool") to get Visual C++ path and find Visual C++ tools detected by Bazel in their repository rule. Change-Id: Ifb6d1f412e64251f413a59d3149d44ca2f8bc5d7 PiperOrigin-RevId: 177589321
* Add 'assemble' action_config for Windows.Gravatar Seth Greenstein2017-11-17
| | | | | | | | | | | Allows .asm files to be included in srcs. ml64.exe is used to create .o files which can later be linked. However, this change will not allow custom flags to be passed to ml64.exe other than /I and /D. Fixes #3648 Closes #3887. Change-Id: I42b6ff76d526abed440bb7f0e0ed4cc3812b4893 PiperOrigin-RevId: 176085382
* Windows: genenrate a fake CROSSTOOL when VC not foundGravatar Yun Peng2017-10-18
| | | | | | | | | | | | | | | | When Visual C++ build tools are not found on Windows, we generating a fake CROSSTOOL so that users can still build for other languages. In the fake CROSSTOOL, we point all tools to a batch script which prints error messages to notify users when they try to build any cc targets. Also, added an extra default_toolchain specification for x64_windows cpu value, so that users can use this cpu in select on non-Windows platforms. Fixed https://github.com/bazelbuild/bazel/issues/3853 Change-Id: Ib4d7a38fd4d98075f6b73ce310c28822e58af4e2 PiperOrigin-RevId: 172341985
* Windows: Add static_link_msvcrt and related featuresGravatar Yun Peng2017-09-26
| | | | | | | | | | | | | | | This is to replace using USE_DYNAMIC_CRT env variable to configure msvcrt linking in CROSSTOOL. If user applies static_link_msvcrt feature to a specific target, Bazel will choose the correct options for statically linking msvcrt. If static_link_msvcrt is not specified, Bazel uses options for dynamically linking msvcrt by default. https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx Change-Id: Ia078dfb528de9ffdd8a11d392db9eb3f34463b09 PiperOrigin-RevId: 170021927
* windows_cc_configure.bzl: Clear PATH, INCLUDE, LIB envsGravatar Yun Peng2017-08-04
| | | | | | | | | | | | | This change prevents leaking irrelevant envs to C++ actions. Before running VCVARSALL.BAT, we set PATH=<system root> INCLUDE= LIB= See https://github.com/bazelbuild/bazel/issues/3500 Change-Id: I767a36a3be3c8c01ad5cac2a7762edd34047e1bf PiperOrigin-RevId: 164242012
* windows_cc_configure.bzl: Set maxsplit to 1 when parsing environment variablesGravatar pcloudy2017-07-25
| | | | | | | fix https://github.com/bazelbuild/bazel/issues/3442 RELNOTES: PiperOrigin-RevId: 163039890
* Add support for Visual Studio 2017 in cc_configure auto-detection and our ↵Gravatar Philipp Wollermann2017-07-14
| | | | | | | | | Python tests. RELNOTES: None. Change-Id: I76c4f11323b1c0690e20d54f129abd671275acb0 PiperOrigin-RevId: 161934858
* Windows: Switch wrapper-less CROSSTOOL to defaultGravatar pcloudy2017-07-12
| | | | | | | | | set USE_MSVC_WRAPPER=1 if you still want to use wrapper script. RELNOTES: Windows: Wrapper-less CROSSTOOL becomes default now. set USE_MSVC_WRAPPER=1 if you still want to use wrapper script. PiperOrigin-RevId: 161654018
* Only configure wrapper scripts when they are neededGravatar Yun Peng2017-07-05
| | | | | | | | | BAZEL_PYTHON is no logger needed if we don't use wrapper script. Also, decode stdout and stderr so that tests work with Python 3. Change-Id: I61b60775a51f8322b40f7682e6cf3f63e8e8b6cc PiperOrigin-RevId: 160874163
* Output more debug information when running python testsGravatar Yun Peng2017-06-28
| | | | | | | This is for debugging https://github.com/bazelbuild/bazel/issues/3273 Change-Id: I84e260ae1a22147fed0cffc2960352c77af2cf58 PiperOrigin-RevId: 160399209
* Stop adding python paths into INCLUDE and LIBGravatar Yun Peng2017-06-27
| | | | | | | See https://github.com/bazelbuild/bazel/issues/3237 Change-Id: I4befad7a329695a952f792605b4936b93cfa2a7f PiperOrigin-RevId: 160249037
* Fix include check on WindowsGravatar Yun Peng2017-06-26
| | | | | | | | | | | Don't add $TMP as cxx_builtin_include_directory, instead use $TMP/nvcc_inter_files_tmp_dir as tmp direcotry for nvcc.exe Fixed https://github.com/bazelbuild/bazel/issues/3202 RELNOTES: None. PiperOrigin-RevId: 160109290
* Get rid of batch script in MSVC CROSSTOOLGravatar Yun Peng2017-06-26
| | | | | | | Now the MSVC CROSSTOOL can truly be wrapper-free! \o/ RELNOTES: None. PiperOrigin-RevId: 159962674
* Refactor cc_configure.bzlGravatar Yun Peng2017-06-22
Split original cc_configure.bzl into 4 different files: lib_cc_configure.bzl: base library for C++ toolchain configuration unix_cc_configure.bzl: For Unix platforms osx_cc_configure.bzl: For macOS windows_cc_configure.bzl: For Windows Change-Id: I76fa44294c6ca4304f0a94f3a1c57d6e76141667 PiperOrigin-RevId: 159801973