From 71c2f69a63c03fb797345762f861d3a587c8c5a1 Mon Sep 17 00:00:00 2001 From: Siddharth Bharat Purohit Date: Tue, 21 Jun 2016 19:56:18 +0530 Subject: [PATCH] waf: add support for sitl build on mac --- Tools/ardupilotwaf/boards.py | 12 +++++++++--- Tools/ardupilotwaf/cxx_checks.py | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 566d632a1f..f121def9ec 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -148,9 +148,15 @@ class Board: '-O0', ] - env.LINKFLAGS += [ - '-Wl,--gc-sections', - ] + if cfg.env.DEST_OS == 'darwin': + env.LINKFLAGS += [ + '-Wl,-dead_strip', + ] + else: + env.LINKFLAGS += [ + '-Wl,--gc-sections', + ] + def build(self, bld): bld.ap_version_append_str('GIT_VERSION', bld.git_head_hash(short=True)) diff --git a/Tools/ardupilotwaf/cxx_checks.py b/Tools/ardupilotwaf/cxx_checks.py index e342686e84..87b8403536 100644 --- a/Tools/ardupilotwaf/cxx_checks.py +++ b/Tools/ardupilotwaf/cxx_checks.py @@ -126,6 +126,9 @@ def ap_common_checks(cfg): @conf def check_librt(cfg, env): + if cfg.env.DEST_OS == 'darwin': + return True + ret = cfg.check( compiler='cxx', fragment='''