aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwarptangent <warptangent@tutanota.com>2016-02-12 11:32:37 -0800
committerwarptangent <warptangent@tutanota.com>2016-02-12 14:49:43 -0800
commit3e72d97ca7d9fa4d130833d84108d08b92e97467 (patch)
tree37cdba00bac096a7d6821e2238ed234b3a3b2753
parentMerge pull request #650 (diff)
downloadmonero-3e72d97ca7d9fa4d130833d84108d08b92e97467.tar.xz
cmake: Fix overly broad use of dynamic link settings
Remove LINK_SEARCH_START_STATIC and LINK_SEARCH_END_STATIC. This is more appropriate when the compiler flag -static is used. This had been causing CMake to omit the linker flags necesssary to distinguish static and dynamic library linking. CMake had assumed static linking for the target, causing it to omit explicit static link flags. That is problematic without the -static compile flag being set. With a library located in system directories, like libboost_date_time, the full static path (.a), though found correctly by CMake, was treated by the linker as a dynamic library. This is because target_link_libraries() transforms the full path to -l<libname> if it's in a system directory. Without -static or explicit linker flags, the dynamic library (.so) is linked. Removing the above two properties removes the assumption of static. So -Wl;-Bstatic is inserted where needed. This causes -l<libname> to properly refer to the static library instead of dynamic.
Diffstat (limited to '')
-rw-r--r--src/CMakeLists.txt9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 036908f37..0ac4a0aa1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -63,15 +63,6 @@ function (bitmonero_add_executable name)
set_property(TARGET "${name}"
PROPERTY
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
-
- if (STATIC)
- set_property(TARGET "${name}"
- PROPERTY
- LINK_SEARCH_START_STATIC 1)
- set_property(TARGET "${name}"
- PROPERTY
- LINK_SEARCH_END_STATIC 1)
- endif ()
endfunction ()
function (bitmonero_add_library name)