From: Louis Dionne Date: Sat, 22 Sep 2018 18:39:38 +0000 (+0000) Subject: [libcxx] Fix the definition of the check-cxx-abilist target on Darwin X-Git-Tag: llvmorg-8.0.0-rc1~8169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a15c924ae04548be5f27bb56bd6574a68130468;p=platform%2Fupstream%2Fllvm.git [libcxx] Fix the definition of the check-cxx-abilist target on Darwin Summary: r342805 added support for the check-cxx-abilist target on FreeBSD, but broke the target on macOS in doing so. The problem is that the GENERIC_TARGET_TRIPLE gets overwritten after replacing the FreeBSD regular expression, which nullifies the replacement done with the darwin regular expression. Reviewers: dim, EricWF Subscribers: emaste, mgorny, krytarowski, christof, dexonsmith, cfe-commits, libcxx-commits Differential Revision: https://reviews.llvm.org/D52394 llvm-svn: 342813 --- diff --git a/libcxx/lib/abi/CMakeLists.txt b/libcxx/lib/abi/CMakeLists.txt index e65df03..bb9217f 100644 --- a/libcxx/lib/abi/CMakeLists.txt +++ b/libcxx/lib/abi/CMakeLists.txt @@ -1,12 +1,16 @@ if (DEFINED TARGET_TRIPLE) - # Ignore the major, minor, and patchlevel versions of darwin targets. - string(REGEX REPLACE "darwin[0-9]+\\.[0-9]+\\.[0-9]+" "darwin" - GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}") - - # Ignore the major and minor versions of freebsd targets. - string(REGEX REPLACE "freebsd[0-9]+\\.[0-9]+" "freebsd" - GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}") + if (TARGET_TRIPLE MATCHES "darwin") + # Ignore the major, minor, and patchlevel versions of darwin targets. + string(REGEX REPLACE "darwin[0-9]+\\.[0-9]+\\.[0-9]+" "darwin" + GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}") + elseif(TARGET_TRIPLE MATCHES "freebsd") + # Ignore the major and minor versions of freebsd targets. + string(REGEX REPLACE "freebsd[0-9]+\\.[0-9]+" "freebsd" + GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}") + else() + set(GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}") + endif() endif() # Detect if we are building in the same configuration used to generate