diff options
author | Brad King <brad.king@kitware.com> | 2020-11-04 14:45:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-04 14:45:28 (GMT) |
commit | 606b34b3a6eeac1bcd64c274b5407cc2cd6be2bd (patch) | |
tree | 05348b2208a3ca1711d45046566d6fa59042c705 | |
parent | 622ac065d2abeb53de3548b7e4f3d9b5980dfa8d (diff) | |
download | CMake-606b34b3a6eeac1bcd64c274b5407cc2cd6be2bd.zip CMake-606b34b3a6eeac1bcd64c274b5407cc2cd6be2bd.tar.gz CMake-606b34b3a6eeac1bcd64c274b5407cc2cd6be2bd.tar.bz2 |
CMakeDetermineCompilerABI: Look for more INFO strings in test binary
Explicitly use only the first occurrence of each matched INFO string
since previously we only extracted the first two anyway.
-rw-r--r-- | Modules/CMakeDetermineCompilerABI.cmake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 7e5b375..3fa99df 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -75,12 +75,14 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) message(CHECK_PASS "done") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n") - file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]") + file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 32 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]") + set(ABI_SIZEOF_DPTR "NOTFOUND") + set(ABI_NAME "NOTFOUND") foreach(info ${ABI_STRINGS}) - if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]") + if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]" AND NOT ABI_SIZEOF_DPTR) set(ABI_SIZEOF_DPTR "${CMAKE_MATCH_1}") endif() - if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]") + if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]" AND NOT ABI_NAME) set(ABI_NAME "${CMAKE_MATCH_1}") endif() endforeach() |