Similar to the handling of darwin target triples, strip the version
authorDimitry Andric <dimitry@andric.com>
Sat, 22 Sep 2018 14:37:49 +0000 (14:37 +0000)
committerDimitry Andric <dimitry@andric.com>
Sat, 22 Sep 2018 14:37:49 +0000 (14:37 +0000)
numbers off of freebsd target triples, when generating the name of the
ABI list file for check-cxx-abilist target.

Also remove unnecessary parentheses in the regex for darwin, and
slightly reword the comment.

llvm-svn: 342805

libcxx/lib/abi/CMakeLists.txt

index e42e961..e65df03 100644 (file)
@@ -1,9 +1,12 @@
 
 if (DEFINED TARGET_TRIPLE)
-    # Ignore the major, minor, and patchlevel versions of the darwin
-    # target.
-    string(REGEX REPLACE "darwin([0-9]+)\\.([0-9]+)\\.([0-9]+)" "darwin"
-      GENERIC_TARGET_TRIPLE "${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}")
 endif()
 
 # Detect if we are building in the same configuration used to generate