1 # Copyright Louis Dionne 2013-2017
2 # Copyright Markus J. Weber 2015
3 # Distributed under the Boost Software License, Version 1.0.
4 # (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
7 # This CMake module checks whether the current compiler is supported, and
8 # provides friendly hints to the user.
10 if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
11 if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "3.9.1")
13 ### You appear to be using Clang ${CMAKE_CXX_COMPILER_VERSION}, which is known
14 ### to be unable to compile Hana. Consider switching to
15 ### Clang >= 3.9.1. If it is already installed on your
16 ### system, you can tell CMake about it with
18 ### cmake .. -DCMAKE_CXX_COMPILER=/path/to/clang
23 if(${MSVC_VERSION} LESS 1900)
26 ### We detected that you were using Clang for Windows with a
27 ### -fms-compatibility-version parameter lower than 19. Only
28 ### -fms-compatibility-version=19 and above are supported by
29 ### Hana for lack of proper C++14 support prior for versions
32 ### If this diagnostic is wrong and you are not using
33 ### -fms-compatibility-version, please file an issue at
34 ### https://github.com/boostorg/hana/issues.
39 elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
40 if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "6.1.0")
42 ### You appear to be using Apple's Clang ${CMAKE_CXX_COMPILER_VERSION}, which is
43 ### shipped with Xcode < 6.3. Unfortunately, only Apple's Clang
44 ### >= 6.1.0 (shipped with Xcode >= 6.3) can compile Hana.
45 ### You should consider updating to Xcode >= 6.3 (requires Yosemite)
46 ### or using a non-Apple Clang >= 3.9.1, which can be installed via
49 ### brew install llvm --with-clang
51 ### You can then tell CMake to use that non-system Clang with
53 ### cmake .. -DCMAKE_CXX_COMPILER=/path/to/clang
56 elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
57 if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "6.0.0")
59 ### You appear to be using GCC ${CMAKE_CXX_COMPILER_VERSION}, which is known to be
60 ### unable to compile Hana. Only GCC >= 6.0.0 is supported.
61 ### Consider using a more recent GCC or switching to Clang.
62 ### If a more recent compiler is already installed on your
63 ### system, you can tell CMake to use it with
65 ### cmake .. -DCMAKE_CXX_COMPILER=/path/to/compiler
70 ### Using the native Microsoft compiler (MSVC) is not supported for lack
71 ### of proper C++14 support. However, you can install pre-built Clang for
72 ### Windows binaries (with Visual Studio integration if desired) at
73 ### http://llvm.org/releases/download.html.
75 ### More information about how to set up Hana with Clang for Windows is
76 ### available on Hana's wiki at http://git.io/vBYIp.
80 ### You appear to be using a compiler that is not yet tested with Hana.
81 ### Please tell us whether it successfully compiles or if and how it
82 ### fails by opening an issue at https://github.com/boostorg/hana/issues.