diff options
author | akhropov <akhropov@yandex-team.com> | 2024-02-04 02:16:21 +0300 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-02-09 19:17:38 +0300 |
commit | 871072f17990a5de95a9695926fa2a32daef2e92 (patch) | |
tree | dcf9217eaccaf4ab3fbfee85cb5a42b94c8040bd | |
parent | 055fb4247521918239057d343e52f835d818e3e1 (diff) | |
download | ydb-871072f17990a5de95a9695926fa2a32daef2e92.tar.gz |
Support nonstandard 'ar' versions
-rw-r--r-- | build/export_generators/hardcoded-cmake/build/scripts/create_recursive_library_for_cmake.py | 5 | ||||
-rw-r--r-- | build/scripts/create_recursive_library_for_cmake.py | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/build/export_generators/hardcoded-cmake/build/scripts/create_recursive_library_for_cmake.py b/build/export_generators/hardcoded-cmake/build/scripts/create_recursive_library_for_cmake.py index 7ba030ac21..33805d18d8 100644 --- a/build/export_generators/hardcoded-cmake/build/scripts/create_recursive_library_for_cmake.py +++ b/build/export_generators/hardcoded-cmake/build/scripts/create_recursive_library_for_cmake.py @@ -6,6 +6,7 @@ import argparse import os +import re import shlex import subprocess import sys @@ -129,9 +130,9 @@ class FilesCombiner(object): archiver_tool_path = 'libtool' elif opts.is_msvc_compatible_linker: arch_type = 'LIB' - elif opts.parsed_args.cmake_ar.endswith('llvm-ar'): + elif re.match('^(|.*/)llvm\-ar(\-[\d])?', opts.parsed_args.cmake_ar): arch_type = 'LLVM_AR' - elif opts.parsed_args.cmake_ar.endswith('ar'): + elif re.match('^(|.*/)(gcc\-)?ar(\-[\d])?', opts.parsed_args.cmake_ar): arch_type = 'GNU_AR' else: raise Exception('Unsupported arch type for CMAKE_AR={}'.format(opts.parsed_args.cmake_ar)) diff --git a/build/scripts/create_recursive_library_for_cmake.py b/build/scripts/create_recursive_library_for_cmake.py index 7ba030ac21..33805d18d8 100644 --- a/build/scripts/create_recursive_library_for_cmake.py +++ b/build/scripts/create_recursive_library_for_cmake.py @@ -6,6 +6,7 @@ import argparse import os +import re import shlex import subprocess import sys @@ -129,9 +130,9 @@ class FilesCombiner(object): archiver_tool_path = 'libtool' elif opts.is_msvc_compatible_linker: arch_type = 'LIB' - elif opts.parsed_args.cmake_ar.endswith('llvm-ar'): + elif re.match('^(|.*/)llvm\-ar(\-[\d])?', opts.parsed_args.cmake_ar): arch_type = 'LLVM_AR' - elif opts.parsed_args.cmake_ar.endswith('ar'): + elif re.match('^(|.*/)(gcc\-)?ar(\-[\d])?', opts.parsed_args.cmake_ar): arch_type = 'GNU_AR' else: raise Exception('Unsupported arch type for CMAKE_AR={}'.format(opts.parsed_args.cmake_ar)) |