summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Kertesz <[email protected]>2017-07-03 21:33:18 +0300
committerCsaba Kertesz <[email protected]>2017-07-03 21:33:18 +0300
commit7299257f5e30e9e4612ec42a1b2f5165ed02b43e (patch)
treeab69d2c4271fc16695119773d1354e5cb854af0a
parentc2d40c030ae315d8eed3d2b1584ac2eb6bd9b0f5 (diff)
Fix the KStars linking for gslcblas when gcc is used
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 241601c..c983190 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -326,6 +326,14 @@ IF (UNIX OR APPLE)
# ld.gold is 2x faster than normal ld
IF (NOT APPLE AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES arm)
SET(LINKER_FLAGS "${LINKER_FLAGS} -fuse-ld=gold")
+ # We have Gsl library what is a special case for linking:
+ # The gsl library must be linked with cblas. There are two alternatives for this: libcblas or libgslcblas.
+ # For example, CMake gets the GSL_LIBRARIES linking flags from the pkgconfig (gsl.pc) file on Ubuntu.
+ # This file defines -lgsl -lglscblas for linking flags and if KStars is compiled with Clang, the linker
+ # finds out magically that KStars must be linked against glscblas library, but gslcblas is omitted in linking
+ # stage if KStars is built with gcc. The linker must be instructed explicitly to link against all libraries
+ # passed on command line by -Wl,--no-as-needed.
+ SET(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--no-as-needed")
# Use Identical Code Folding
SET(COMP_FLAGS "${COMP_FLAGS} -ffunction-sections")
SET(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--icf=safe")