CMake: "fix" static linking (remove -pie)
Stop linking with -pie, as it prevents from linking statically.
This commit is contained in:
parent
2bfd0ee009
commit
245c7f38b2
|
@ -108,10 +108,14 @@ if ("${CMAKE_SHARED_LINKER_FLAGS}" STREQUAL " ")
|
|||
endif()
|
||||
|
||||
# Linker flags when linking an executable
|
||||
if ("${CMAKE_EXE_LINKER_FLAGS}" STREQUAL " ")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-pie -fPIE"
|
||||
CACHE STRING "Set default shared linker flags" FORCE)
|
||||
endif()
|
||||
# Note: -fpie prevents from building static executables, therefore it
|
||||
# has been deactivated, but it would be nice to find a work-around
|
||||
# to allow building dynamic (and semistatic) targets with -pie and
|
||||
# static ones without.
|
||||
#if ("${CMAKE_EXE_LINKER_FLAGS}" STREQUAL " ")
|
||||
# set(CMAKE_EXE_LINKER_FLAGS "-pie -fPIE"
|
||||
# CACHE STRING "Set default shared linker flags" FORCE)
|
||||
#endif()
|
||||
|
||||
|
||||
### Libraries targets ###
|
||||
|
|
Loading…
Reference in New Issue