@@ -3,26 +3,35 @@ function(vcpkg_detect_compiler)
3
3
if (NOT DEFINED CACHE {VCPKG_COMPILER})
4
4
if (CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
5
5
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
6
- message (FATAL_ERROR
7
- "The g++ version picked up is too old; please install a newer compiler such as g++-7.
8
- On Ubuntu try the following:
9
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
10
- sudo apt-get update -y
11
- sudo apt-get install g++-7 -y
12
- On CentOS try the following:
13
- sudo yum install centos-release-scl
14
- sudo yum install devtoolset-7
15
- scl enable devtoolset-7 bash" )
6
+ message (FATAL_ERROR [[
7
+ The g++ version picked up is too old; please install a newer compiler such as g++-7.
8
+ On Ubuntu try the following:
9
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
10
+ sudo apt-get update -y
11
+ sudo apt-get install g++-7 -y
12
+ On CentOS try the following:
13
+ sudo yum install centos-release-scl
14
+ sudo yum install devtoolset-7
15
+ scl enable devtoolset-7 bash
16
+ ]])
16
17
endif ()
17
18
18
19
set (COMPILER "gcc" )
19
20
elseif (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" )
20
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0.0" AND NOT VCPKG_ALLOW_APPLE_CLANG)
21
- message (FATAL_ERROR
22
- "Building the vcpkg tool requires support for the C++ Filesystem TS.
23
- Apple clang versions 10.01 and below do not have support for it.
24
- Please install gcc6 or newer from homebrew (brew install gcc).
25
- If you would like to try anyway, pass --allowAppleClang to bootstrap.sh." )
21
+ #[[
22
+ Note: CMAKE_SYSTEM_VERSION uses darwin versions
23
+ - Darwin 19.0.0 = macOS 10.15, iOS 13
24
+ - Darwin 18.0.0 = macOS 10.14, iOS 12
25
+ - Darwin 17.0.0 = macOS 10.13, iOS 11
26
+ - Darwin 16.0.0 = macOS 10.12, iOS 10
27
+ ]]
28
+ if (CMAKE_SYSTEM_VERSION VERSION_LESS "19.0.0" AND NOT VCPKG_ALLOW_APPLE_CLANG)
29
+ message (FATAL_ERROR [[
30
+ Building the vcpkg tool requires support for the C++ Filesystem TS.
31
+ macOS versions below 10.15 do not have support for it with Apple Clang.
32
+ Please install gcc6 or newer from homebrew (brew install gcc).
33
+ If you would like to try anyway, pass --allowAppleClang to bootstrap.sh.
34
+ ]])
26
35
endif ()
27
36
set (COMPILER "clang" )
28
37
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" )
@@ -48,26 +57,29 @@ function(vcpkg_detect_standard_library)
48
57
49
58
# note: since <ciso646> is the smallest header, generally it's used to get the standard library version
50
59
set (CMAKE_REQUIRED_QUIET ON )
51
- check_cxx_source_compiles(
52
- "#include <ciso646>
53
- #if !defined(__GLIBCXX__)
54
- #error \" not libstdc++\"
55
- #endif
56
- int main() {}"
60
+ check_cxx_source_compiles([[
61
+ #include <ciso646>
62
+ #if !defined(__GLIBCXX__)
63
+ #error "not libstdc++"
64
+ #endif
65
+ int main() {}
66
+ ]]
57
67
_VCPKG_STANDARD_LIBRARY_LIBSTDCXX)
58
- check_cxx_source_compiles(
59
- "#include <ciso646>
60
- #if !defined(_LIBCPP_VERSION)
61
- #error \" not libc++\"
62
- #endif
63
- int main() {}"
68
+ check_cxx_source_compiles([[
69
+ #include <ciso646>
70
+ #if !defined(_LIBCPP_VERSION)
71
+ #error "not libc++"
72
+ #endif
73
+ int main() {}
74
+ ]]
64
75
_VCPKG_STANDARD_LIBRARY_LIBCXX)
65
- check_cxx_source_compiles(
66
- "#include <ciso646>
67
- #if !defined(_MSVC_STL_VERSION)
68
- #error \" not MSVC stl\"
69
- #endif
70
- int main() {}"
76
+ check_cxx_source_compiles([[
77
+ #include <ciso646>
78
+ #if !defined(_MSVC_STL_VERSION)
79
+ #error "not MSVC stl"
80
+ #endif
81
+ int main() {}
82
+ ]]
71
83
_VCPKG_STANDARD_LIBRARY_MSVC_STL)
72
84
if (_VCPKG_STANDARD_LIBRARY_LIBSTDCXX)
73
85
set (STANDARD_LIBRARY "libstdc++" )
@@ -98,32 +110,35 @@ function(vcpkg_detect_std_filesystem)
98
110
99
111
set (CMAKE_REQUIRED_QUIET ON )
100
112
if (VCPKG_STANDARD_LIBRARY STREQUAL "libstdc++" )
101
- check_cxx_source_compiles(
102
- "#include <ciso646>
103
- #if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 9
104
- #error \" libstdc++ after version 9 does not require -lstdc++fs\"
105
- #endif
106
- int main() {}"
113
+ check_cxx_source_compiles([[
114
+ #include <ciso646>
115
+ #if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 9
116
+ #error "libstdc++ after version 9 does not require -lstdc++fs"
117
+ #endif
118
+ int main() {}
119
+ ]]
107
120
_VCPKG_REQUIRE_LINK_CXXFS)
108
121
109
- check_cxx_source_compiles(
110
- "#include <ciso646>
111
- #if !defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE < 8
112
- #error \" libstdc++ before version 8 does not support <filesystem>\"
113
- #endif
114
- int main() {}"
122
+ check_cxx_source_compiles([[
123
+ #include <ciso646>
124
+ #if !defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE < 8
125
+ #error "libstdc++ before version 8 does not support <filesystem>"
126
+ #endif
127
+ int main() {}
128
+ ]]
115
129
_VCPKG_USE_STD_FILESYSTEM)
116
130
elseif (VCPKG_STANDARD_LIBRARY STREQUAL "libc++" )
117
131
if (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" )
118
132
# AppleClang never requires (or allows) -lc++fs, even with libc++ version 8.0.0
119
133
set (_VCPKG_REQUIRE_LINK_CXXFS OFF )
120
134
else ()
121
- check_cxx_source_compiles(
122
- "#include <ciso646>
123
- #if _LIBCPP_VERSION >= 9000
124
- #error \" libc++ after version 9 does not require -lc++fs\"
125
- #endif
126
- int main() {}"
135
+ check_cxx_source_compiles([[
136
+ #include <ciso646>
137
+ #if _LIBCPP_VERSION >= 9000
138
+ #error "libc++ after version 9 does not require -lc++fs"
139
+ #endif
140
+ int main() {}
141
+ ]]
127
142
_VCPKG_REQUIRE_LINK_CXXFS)
128
143
endif ()
129
144
0 commit comments