diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-03-09 01:20:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 01:20:57 +0200 |
commit | 5c51d4521ab37edce88c61fd5067c93a44078854 (patch) | |
tree | 51910cba73b3017087fc13b6bdb64afd3bd4e09e /mesonbuild/compilers/compilers.py | |
parent | 3a57e5177ba949cff5f971f7338a1c75a2724ac2 (diff) | |
parent | 48e5c1234ad4dd0438324ab8164f94d12a8c2218 (diff) | |
download | meson-5c51d4521ab37edce88c61fd5067c93a44078854.zip meson-5c51d4521ab37edce88c61fd5067c93a44078854.tar.gz meson-5c51d4521ab37edce88c61fd5067c93a44078854.tar.bz2 |
Merge pull request #6532 from jon-turney/languages-native-kwarg
Add add_languages(native:)
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index caa8600..366bb50 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -14,6 +14,7 @@ import contextlib, os.path, re, tempfile import collections.abc +import itertools import typing as T from functools import lru_cache @@ -75,6 +76,7 @@ clink_suffixes = () for _l in clink_langs + ('vala',): clink_suffixes += lang_suffixes[_l] clink_suffixes += ('h', 'll', 's') +all_suffixes = set(itertools.chain(*lang_suffixes.values(), clink_suffixes)) # Languages that should use LDFLAGS arguments when linking. languages_using_ldflags = ('objcpp', 'cpp', 'objc', 'c', 'fortran', 'd', 'cuda') @@ -147,6 +149,13 @@ def is_library(fname): suffix = fname.split('.')[-1] return suffix in lib_suffixes +def is_known_suffix(fname): + if hasattr(fname, 'fname'): + fname = fname.fname + suffix = fname.split('.')[-1] + + return suffix in all_suffixes + cuda_buildtype_args = {'plain': [], 'debug': [], 'debugoptimized': [], |