|
20 | 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
21 | 21 | # SOFTWARE. |
22 | 22 |
|
23 | | -set(CONAN_MINIMUM_VERSION 2.0.5) |
| 23 | +set(CONAN_MINIMUM_VERSION 2.4.0) |
24 | 24 |
|
25 | 25 | # Create a new policy scope and set the minimum required cmake version so the |
26 | 26 | # features behind a policy setting like if(... IN_LIST ...) behaves as expected |
@@ -128,6 +128,14 @@ function(detect_arch arch) |
128 | 128 | endfunction() |
129 | 129 |
|
130 | 130 |
|
| 131 | +function(detect_c_standard c_standard) |
| 132 | + set(${c_standard} ${CMAKE_C_STANDARD} PARENT_SCOPE) |
| 133 | + if(CMAKE_C_EXTENSIONS) |
| 134 | + set(${c_standard} "gnu${CMAKE_C_STANDARD}" PARENT_SCOPE) |
| 135 | + endif() |
| 136 | +endfunction() |
| 137 | + |
| 138 | + |
131 | 139 | function(detect_cxx_standard cxx_standard) |
132 | 140 | set(${cxx_standard} ${CMAKE_CXX_STANDARD} PARENT_SCOPE) |
133 | 141 | if(CMAKE_CXX_EXTENSIONS) |
@@ -363,6 +371,7 @@ function(detect_host_profile output_file) |
363 | 371 | detect_os(os os_api_level os_sdk os_subsystem os_version) |
364 | 372 | detect_arch(arch) |
365 | 373 | detect_compiler(compiler compiler_version compiler_runtime compiler_runtime_type) |
| 374 | + detect_c_standard(compiler_cstd) |
366 | 375 | detect_cxx_standard(compiler_cppstd) |
367 | 376 | detect_lib_cxx(compiler_libcxx) |
368 | 377 | detect_build_type(build_type) |
@@ -399,6 +408,9 @@ function(detect_host_profile output_file) |
399 | 408 | if(compiler_runtime_type) |
400 | 409 | string(APPEND profile compiler.runtime_type=${compiler_runtime_type} "\n") |
401 | 410 | endif() |
| 411 | + if(compiler_cstd) |
| 412 | + string(APPEND profile compiler.cstd=${compiler_cstd} "\n") |
| 413 | + endif() |
402 | 414 | if(compiler_cppstd) |
403 | 415 | string(APPEND profile compiler.cppstd=${compiler_cppstd} "\n") |
404 | 416 | endif() |
|
0 commit comments