From 93d261a558238464a4dec85afabe0b26ac7b05c7 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Tue, 26 Apr 2016 13:04:58 -0400 Subject: [PATCH] cmake fix px4_base linker flags --- cmake/common/px4_base.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmake/common/px4_base.cmake b/cmake/common/px4_base.cmake index 30ccd86b5d..22bcde71f2 100644 --- a/cmake/common/px4_base.cmake +++ b/cmake/common/px4_base.cmake @@ -566,6 +566,7 @@ function(px4_add_common_flags) # QuRT 6.4.X compiler identifies as Clang but does not support this option if (NOT ${OS} STREQUAL "qurt") list(APPEND warnings + -Qunused-arguments -Wno-unused-const-variable -Wno-varargs ) @@ -701,14 +702,11 @@ function(px4_add_common_flags) -DCONFIG_ARCH_BOARD_${board_config} ) - if (NOT ${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*") - set(added_exe_link_flags + if (NOT (APPLE AND (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*"))) + set(added_exe_linker_flags -Wl,--warn-common -Wl,--gc-sections - ) - else() - set(added_exe_link_flags - -Wl,--warn-common + #,--print-gc-sections ) endif()