diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2018-12-03 23:18:43 +0100 |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2018-12-03 23:18:43 +0100 |
commit | 243b7c40d44df2c8b1cb0dc55e2a11b15d9e6f5d (patch) | |
tree | 7a4d048fdf004b8f9aed2d5a4422a63ed28ff418 /Modules/CMakeDetermineCXXCompiler.cmake | |
parent | 985a57a1c1ca6989524805bb3e91a222906f88ca (diff) | |
download | cmake-243b7c40d44df2c8b1cb0dc55e2a11b15d9e6f5d.tar.gz |
QNX: Compiler and feature detection fixes
Tested compiler detection with the QNX 7.0 list of compiler targets:
* gcc_ntoaarch64le
* gcc_ntoaarch64le_cxx
* gcc_ntoarmv7le
* gcc_ntoarmv7le_cxx
* gcc_ntox86_cxx
* gcc_ntoaarch64le_gpp
* gcc_ntox86_64_gpp
* gcc_ntoarmv7le_gpp
* gcc_ntox86_64_cxx
* gcc_ntox86
* gcc_ntox86_gpp
* gcc_ntox86_64
This commit fixes some of the problems described in:
https://cristianadam.eu/20181202/a-better-qnx-cmake-toolchain-file/
Diffstat (limited to 'Modules/CMakeDetermineCXXCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 70d17a1810..0a0c37b48a 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -133,7 +133,7 @@ endif () if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) - if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|QCC") get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)(clan)?[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) @@ -142,7 +142,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-) endif() elseif(COMPILER_BASENAME MATCHES "QCC(\\.exe)?$") - if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?") + if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([a-z0-9]+_[0-9]+|[^_le]+)(le)") set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-) endif() endif () |