From 1d94429947f47a388f594d88fe7c68c0170a41c3 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 31 Jan 2017 14:49:03 +0100 Subject: [PATCH] Correctly pass arguments to kiwix-tools meson script. Now that meson.build script add itself the needed link flags to link static binaries, we don't need to add them by ourself. Just pass the right option to meson. --- kiwix-build.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kiwix-build.py b/kiwix-build.py index 62a7a22..5a6a24a 100755 --- a/kiwix-build.py +++ b/kiwix-build.py @@ -569,6 +569,7 @@ class CMakeBuilder(MakeBuilder): env.update(self.configure_env) self.buildEnv.run_command(command, self.build_path, context, env=env, allow_wrapper=False) + class MesonBuilder(Builder): configure_option = "" def _gen_env(self): @@ -578,8 +579,6 @@ class MesonBuilder(Builder): else pj(self.buildEnv.install_dir, self.buildEnv.libprefix, 'pkgconfig') ) env['PATH'] = ':'.join([pj(self.buildEnv.install_dir, 'bin'), env['PATH']]) - if self.buildEnv.build_static: - env['LDFLAGS'] = env['LDFLAGS'] + " -static-libstdc++ --static" return env def _configure(self, context): @@ -808,7 +807,12 @@ class KiwixTools(Dependency): git_dir = "kiwix-tools" class Builder(MesonBuilder): - configure_option = "-Dctpp2-install-prefix={buildEnv.install_dir}" + @property + def configure_option(self): + base_options = "-Dctpp2-install-prefix={buildEnv.install_dir}" + if self.buildEnv.build_static: + base_options += " -Dstatic-linkage=true" + return base_options class Builder: