From 6b34d549451ca98d1ab758bf509e2a03b4eedc4a Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 5 Feb 2016 21:58:39 -0500 Subject: [PATCH] Prefer MSVC over GCC if both are in %PATH%. Notably, putting Strawberry Perl in %PATH% will usually end up putting a copy of gcc in %PATH%, which trips up people trying to build on Windows. This is arguably misusing the variable (normally set by the generator), but it should work. Change-Id: I13a011eb33688ae928a56cce266edd2759a3cb32 Reviewed-on: https://boringssl-review.googlesource.com/7070 Reviewed-by: Adam Langley --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19ee1ca0..84935598 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,16 @@ cmake_minimum_required (VERSION 2.8.10) -project (BoringSSL) +# Defer enabling C and CXX languages. +project (BoringSSL NONE) + +if(WIN32) + # On Windows, prefer cl over gcc if both are available. By default most of + # the CMake generators prefer gcc, even on Windows. + set(CMAKE_GENERATOR_CC cl) +endif() + +enable_language(C) +enable_language(CXX) if(ANDROID) # Android-NDK CMake files reconfigure the path and so Go and Perl won't be