diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d05151..6700035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ###