Skip to content

Commit

Permalink
Update cmake_129_workaround.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Nov 29, 2020
1 parent b17c681 commit 6c5bd6b
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions recipe/cmake_129_workaround.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
From 5c94221ac3556ae5c90440d60a61913fa54d1335 Mon Sep 17 00:00:00 2001
From dfea6a5a16660177af31884c5ffa13d2009bbd5a Mon Sep 17 00:00:00 2001
From: Silvio Traversaro <silvio@traversaro.it>
Date: Sun, 29 Nov 2020 19:03:49 +0100
Subject: [PATCH] Update GazeboUtils.cmake
Date: Sun, 29 Nov 2020 19:24:43 +0100
Subject: [PATCH] Do not overwrite default linker flags

---
cmake/GazeboUtils.cmake | 4 ++++
1 file changed, 4 insertions(+)
cmake/DefaultCFlags.cmake | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmake/GazeboUtils.cmake b/cmake/GazeboUtils.cmake
index 6842ae7c91..f0f66776ba 100644
--- a/cmake/GazeboUtils.cmake
+++ b/cmake/GazeboUtils.cmake
@@ -147,6 +147,10 @@ endmacro ()
macro (gz_setup_unix)
# Using dynamic linking in UNIX by default
set(BUILD_SHARED_LIBS TRUE)
+ # Workaround for https://github.com/conda-forge/cmake-feedstock/issues/129
+ add_link_options("-L${CMAKE_INSTALL_PREFIX}/lib")
+ add_link_options("-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib")
+ add_link_options("-Wl,-rpath-link,${CMAKE_INSTALL_PREFIX}/lib")
endmacro()
diff --git a/cmake/DefaultCFlags.cmake b/cmake/DefaultCFlags.cmake
index ca02ba295d..a6a11b5fd8 100644
--- a/cmake/DefaultCFlags.cmake
+++ b/cmake/DefaultCFlags.cmake
@@ -37,10 +37,10 @@ endif()

#####################################
# Set all the global build flags
-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}")
-set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}")
-set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}")
-set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}")
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}")
+set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}")
+set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}")
+set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}")

# Compiler-specific C++11 activation.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")

#################################################

0 comments on commit 6c5bd6b

Please sign in to comment.