Skip to content

Commit

Permalink
[yugabyte#7994]: docdb: Fixed clang 10.* version detection
Browse files Browse the repository at this point in the history
Summary:
Commit yugabyte@306d57f added thread safety improvements in the Transaction class and disabled thread-safety annotations/analysis for clang versions prior to 11. But clang version was incorrectly detected if reported as `Apple LLVM version 10.0.1 (clang-1001.0.46.4)`. Therefore, for such compiler versions, thread-safety annotations were enabled and causing compilation failures, because thread safety analysis does not work well with unique_lock prior to clang 11.

Fixed apple clang version detection in this case.

Test Plan: Jenkins, check logs and make sure the version of apple clang was reported as `Apple LLVM version 10.*`, detected correctly as `10.*` and compilation has been successfully completed.

Reviewers: dmitry, mbautin, bogdan

Reviewed By: bogdan

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D11215
  • Loading branch information
ttyusupov committed Apr 12, 2021
1 parent 41a5225 commit d66155e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake_modules/CompilerInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ elseif("${COMPILER_VERSION_FULL}" MATCHES ".*clang-700\\..*")
set(COMPILER_VERSION "3.7.0svn")

# a different version of clang
elseif("${COMPILER_VERSION_FULL}" MATCHES "Apple LLVM version ([0-9]+([.][0-9]+)*) .*")
set(COMPILER_FAMILY "clang")
set(COMPILER_VERSION "${CMAKE_MATCH_1}")
elseif("${COMPILER_VERSION_FULL}" MATCHES ".*[(]clang-[0-9.]+[)].*")
set(COMPILER_FAMILY "clang")
string(REGEX REPLACE ".*[(]clang-([0-9.]+)[)].*" "\\1"
Expand Down

0 comments on commit d66155e

Please sign in to comment.