diff options
author | Aleksey Gurtovoy <agurtovoy@acm.org> | 2019-09-06 12:31:26 -0500 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-09-24 14:22:20 -0700 |
commit | 6ac5db50c901f172176b297d087e6123df497062 (patch) | |
tree | c57cab2ef12633b760ab0189539a932e3b465817 /mesonbuild/backend | |
parent | 1670fca36fcb1a4fe4780e96731e954515501a35 (diff) | |
download | meson-6ac5db50c901f172176b297d087e6123df497062.zip meson-6ac5db50c901f172176b297d087e6123df497062.tar.gz meson-6ac5db50c901f172176b297d087e6123df497062.tar.bz2 |
CUDA support on Windows
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/backends.py | 26 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 8 |
2 files changed, 5 insertions, 29 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 773c75e..30de716 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -20,7 +20,7 @@ from .. import mesonlib from .. import mlog import json import subprocess -from ..mesonlib import MachineChoice, MesonException, OrderedSet +from ..mesonlib import MachineChoice, MesonException, OrderedSet, OptionOverrideProxy from ..mesonlib import classify_unity_sources from ..mesonlib import File from ..compilers import CompilerArgs, VisualStudioLikeCompiler @@ -105,28 +105,6 @@ class TestSerialisation: self.protocol = protocol self.priority = priority -class OptionProxy: - def __init__(self, value): - self.value = value - -class OptionOverrideProxy: - '''Mimic an option list but transparently override - selected option values.''' - def __init__(self, overrides, *options): - self.overrides = overrides - self.options = options - - def __getitem__(self, option_name): - for opts in self.options: - if option_name in opts: - return self._get_override(option_name, opts[option_name]) - raise KeyError('Option not found', option_name) - - def _get_override(self, option_name, base_opt): - if option_name in self.overrides: - return OptionProxy(base_opt.validate_value(self.overrides[option_name])) - return base_opt - def get_backend_from_name(backend, build): if backend == 'ninja': from . import ninjabackend @@ -650,7 +628,7 @@ class Backend: elif isinstance(dep, dependencies.ExternalLibrary): commands += dep.get_link_args('vala') else: - commands += dep.get_compile_args() + commands += compiler.get_dependency_compile_args(dep) # Qt needs -fPIC for executables # XXX: We should move to -fPIC for all executables if isinstance(target, build.Executable): diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index fc88896..417f6d9 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1882,8 +1882,6 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) return compiler.get_no_stdinc_args() def get_compile_debugfile_args(self, compiler, target, objfile): - if not isinstance(compiler, VisualStudioLikeCompiler): - return [] # The way MSVC uses PDB files is documented exactly nowhere so # the following is what we have been able to decipher via # reverse engineering. @@ -2511,16 +2509,16 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) # For 'automagic' deps: Boost and GTest. Also dependency('threads'). # pkg-config puts the thread flags itself via `Cflags:` - commands += target.link_args + commands += linker.get_target_link_args(target) # External deps must be last because target link libraries may depend on them. for dep in target.get_external_deps(): # Extend without reordering or de-dup to preserve `-L -l` sets # https://github.com/mesonbuild/meson/issues/1718 - commands.extend_preserving_lflags(dep.get_link_args()) + commands.extend_preserving_lflags(linker.get_dependency_link_args(dep)) for d in target.get_dependencies(): if isinstance(d, build.StaticLibrary): for dep in d.get_external_deps(): - commands.extend_preserving_lflags(dep.get_link_args()) + commands.extend_preserving_lflags(linker.get_dependency_link_args(dep)) # Add link args specific to this BuildTarget type that must not be overridden by dependencies commands += self.get_target_type_link_args_post_dependencies(target, linker) |