From bfd5ad3220e7abe928daca98605012c1a12ae377 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Sun, 21 Feb 2016 17:15:31 +0200 Subject: [gyp] Coverage only if BUILDTYPE=Debug and ENABLE_COVERAGE=1 Coverage compiler and linker flags are used only when (1) in debug build and (2) with ENABLE_COVERAGE set to 1. Besides, because OS X's libtool is unable to understand '--coverage', this linker flag is only used genrating executable targets. Also, using 'link_settings' to specify linker options and separate instructions for OSX and Linux. --- test/test.gypi | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/test.gypi b/test/test.gypi index 1842a807fb..f12588890a 100644 --- a/test/test.gypi +++ b/test/test.gypi @@ -100,11 +100,6 @@ 'sprite/sprite_parser.cpp', 'sprite/sprite_store.cpp', ], - 'libraries': [ - '<@(gtest_static_libs)', - '<@(sqlite_static_libs)', - '<@(geojsonvt_static_libs)', - ], 'variables': { 'cflags_cc': [ '<@(gtest_cflags)', @@ -119,29 +114,31 @@ '<@(gtest_ldflags)', '<@(sqlite_ldflags)', ], + 'libraries': [ + '<@(gtest_static_libs)', + '<@(sqlite_static_libs)', + '<@(geojsonvt_static_libs)', + ], }, 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], - 'OTHER_LDFLAGS': [ '<@(ldflags)' ], - }, - 'configurations': { - 'Debug': { - 'xcode_settings': { - 'conditions': [ - ['enable_coverage=="1"', { - 'OTHER_LDFLAGS': [ '--coverage' ], - }], - ], - }, - }, }, }, { 'cflags_cc': [ '<@(cflags_cc)' ], - 'libraries': [ '<@(ldflags)' ], }], ], + 'link_settings': { + 'conditions': [ + ['OS == "mac"', { + 'libraries': [ '<@(libraries)' ], + 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } + }, { + 'libraries': [ '<@(libraries)', '<@(ldflags)' ], + }] + ], + }, }, ] } -- cgit v1.2.1