Merge pull request #2900 from schellap/fpie
Enable stack protect and fpic/fpie for host
This commit is contained in:
commit
3df46ec070
4 changed files with 9 additions and 0 deletions
|
@ -8,6 +8,8 @@ if(WIN32)
|
|||
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
||||
add_compile_options($<$<CONFIG:Release>:/MT>)
|
||||
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
||||
else()
|
||||
add_compile_options(-fPIE)
|
||||
endif()
|
||||
|
||||
include(setup.cmake)
|
||||
|
|
|
@ -8,6 +8,8 @@ if(WIN32)
|
|||
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
||||
add_compile_options($<$<CONFIG:Release>:/MT>)
|
||||
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
||||
else()
|
||||
add_compile_options(-fPIC)
|
||||
endif()
|
||||
|
||||
include(../setup.cmake)
|
||||
|
|
|
@ -8,6 +8,8 @@ if(WIN32)
|
|||
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
||||
add_compile_options($<$<CONFIG:Release>:/MT>)
|
||||
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
||||
else()
|
||||
add_compile_options(-fPIC)
|
||||
endif()
|
||||
|
||||
include(../setup.cmake)
|
||||
|
|
|
@ -43,6 +43,9 @@ endif()
|
|||
# containing the reference instead of using definitions from other modules.
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
|
||||
add_compile_options(-fstack-protector-strong)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
add_compile_options(-fstack-protector)
|
||||
endif()
|
||||
|
||||
if(CLI_CMAKE_PLATFORM_ARCH_I386)
|
||||
|
|
Loading…
Add table
Reference in a new issue