aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-11-22 15:22:41 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-11-22 15:22:41 +0100
commitaa85de386a9de70fb7721ccecb5d1b9c97035c6a (patch)
tree3ad23177443a881048c6b33f3dfea4f39f7dedc3
parentfc47fb553d3ab61079bb288942b0328e4b3392fb (diff)
[HICN-412] Added option LINK_FLAGSgto build_executable to specify link flags
Change-Id: I6b382abe374d896c9ea1e0ef5573ba166fafec94 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
-rw-r--r--apps/CMakeLists.txt2
-rw-r--r--apps/higet/CMakeLists.txt1
-rw-r--r--apps/http-proxy/CMakeLists.txt2
-rw-r--r--cmake/Modules/BuildMacros.cmake4
-rw-r--r--utils/CMakeLists.txt5
5 files changed, 10 insertions, 4 deletions
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
index 9f4e753bb..c74be92ba 100644
--- a/apps/CMakeLists.txt
+++ b/apps/CMakeLists.txt
@@ -46,7 +46,7 @@ endif()
set(SUFFIX "")
if (${LIBTRANSPORT_LIBRARIES} MATCHES ".*-memif.*")
set(SUFFIX "-memif")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-unresolved-symbols=ignore-in-shared-libs")
+ set(LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs")
endif()
set(HICN_APPS "${HICN_APPS}${SUFFIX}")
diff --git a/apps/higet/CMakeLists.txt b/apps/higet/CMakeLists.txt
index 83a13bcca..76814384d 100644
--- a/apps/higet/CMakeLists.txt
+++ b/apps/higet/CMakeLists.txt
@@ -37,4 +37,5 @@ build_executable(${HIGET}
DEPENDS ${LIBTRANSPORT_LIBRARIES}
COMPONENT ${HICN_APPS}
DEFINITIONS ${COMPILER_DEFINITIONS}
+ LINK_FLAGS ${LINK_FLAGS}
)
diff --git a/apps/http-proxy/CMakeLists.txt b/apps/http-proxy/CMakeLists.txt
index 7e29edcf8..cc47e4b6f 100644
--- a/apps/http-proxy/CMakeLists.txt
+++ b/apps/http-proxy/CMakeLists.txt
@@ -55,6 +55,7 @@ build_library(${LIBHTTP_PROXY}
LINK_LIBRARIES ${LIBRARIES}
DEPENDS ${DEPENDENCIES}
INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS}
+ LINK_FLAGS ${LINK_FLAGS}
)
build_executable(${HTTP_PROXY}
@@ -63,4 +64,5 @@ build_executable(${HTTP_PROXY}
DEPENDS ${LIBHTTP_PROXY_STATIC}
COMPONENT ${HICN_APPS}
DEFINITIONS ${COMPILER_DEFINITIONS}
+ LINK_FLAGS ${LINK_FLAGS}
)
diff --git a/cmake/Modules/BuildMacros.cmake b/cmake/Modules/BuildMacros.cmake
index f89902dbc..85789a08a 100644
--- a/cmake/Modules/BuildMacros.cmake
+++ b/cmake/Modules/BuildMacros.cmake
@@ -21,7 +21,7 @@ macro(build_executable exec)
cmake_parse_arguments(ARG
"NO_INSTALL"
"COMPONENT"
- "SOURCES;LINK_LIBRARIES;DEPENDS;INCLUDE_DIRS;DEFINITIONS"
+ "SOURCES;LINK_LIBRARIES;DEPENDS;INCLUDE_DIRS;DEFINITIONS;LINK_FLAGS"
${ARGN}
)
@@ -37,7 +37,7 @@ macro(build_executable exec)
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib"
LIBRARY_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib"
RUNTIME_OUTPUT_DIRECTORY "${BUILD_ROOT}/bin"
- LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs"
+ LINK_FLAGS "${ARG_LINK_FLAGS}"
)
if(ARG_LINK_LIBRARIES)
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 3ed6f9bf3..0e5430356 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -47,7 +47,7 @@ endif()
set(SUFFIX "")
if (${LIBTRANSPORT_LIBRARIES} MATCHES ".*-memif.*")
set(SUFFIX "-memif")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-unresolved-symbols=ignore-in-shared-libs")
+ set(LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs")
endif()
set(HICN_UTILS "${HICN_UTILS}${SUFFIX}")
@@ -66,6 +66,7 @@ build_executable(hiperf
DEPENDS ${DEPENDENCIES}
COMPONENT ${HICN_UTILS}
DEFINITIONS ${COMPILER_DEFINITIONS}
+ LINK_FLAGS ${LINK_FLAGS}
)
build_executable(hicn-ping-server
@@ -74,6 +75,7 @@ build_executable(hicn-ping-server
DEPENDS ${DEPENDENCIES}
COMPONENT ${HICN_UTILS}
DEFINITIONS ${COMPILER_DEFINITIONS}
+ LINK_FLAGS ${LINK_FLAGS}
)
build_executable(hicn-ping-client
@@ -82,4 +84,5 @@ build_executable(hicn-ping-client
DEPENDS ${DEPENDENCIES}
COMPONENT ${HICN_UTILS}
DEFINITIONS ${COMPILER_DEFINITIONS}
+ LINK_FLAGS ${LINK_FLAGS}
)