From 2bb58c909fd80cc8ce053b5f1b6565bd28a416d2 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 21 Jan 2017 12:05:38 +0530 Subject: Use CompilerArgs for generation of compile commands At the same time, also fix the order in which compile arguments are added. Detailed comments have been added concerning the priority and order of the arguments. Also adds a unit test and an integration test for the same. --- mesonbuild/dependencies.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'mesonbuild/dependencies.py') diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py index 6ae91d4..b01e0a8 100644 --- a/mesonbuild/dependencies.py +++ b/mesonbuild/dependencies.py @@ -59,7 +59,7 @@ class Dependency: def get_name(self): return self.name - def get_exe_args(self): + def get_exe_args(self, compiler): return [] def need_threads(self): @@ -1045,16 +1045,14 @@ class QtBaseDependency(Dependency): def found(self): return self.is_found - def get_exe_args(self): + def get_exe_args(self, compiler): # Originally this was -fPIE but nowadays the default # for upstream and distros seems to be -reduce-relocations # which requires -fPIC. This may cause a performance # penalty when using self-built Qt or on platforms # where -fPIC is not required. If this is an issue # for you, patches are welcome. - if mesonlib.is_linux(): - return ['-fPIC'] - return [] + return compiler.get_pic_args() class Qt5Dependency(QtBaseDependency): def __init__(self, env, kwargs): -- cgit v1.1