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()
|
endif()
|
||||||
|
|
||||||
# Linker flags when linking an executable
|
# Linker flags when linking an executable
|
||||||
if ("${CMAKE_EXE_LINKER_FLAGS}" STREQUAL " ")
|
# Note: -fpie prevents from building static executables, therefore it
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "-pie -fPIE"
|
# has been deactivated, but it would be nice to find a work-around
|
||||||
CACHE STRING "Set default shared linker flags" FORCE)
|
# to allow building dynamic (and semistatic) targets with -pie and
|
||||||
endif()
|
# 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 ###
|
### Libraries targets ###
|
||||||
|
|
Loading…
Reference in New Issue