Skip to content

Commit

Permalink
COMP: Mingw: When using -fstack-protection-all, linking to libssp
Browse files Browse the repository at this point in the history
(stack smash protection library) is required.
  • Loading branch information
saschazelzer committed Aug 22, 2010
1 parent 713b888 commit e87fe15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMake/ctkMacroBuildLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ MACRO(ctkMacroBuildLib)
SET(my_libs
${MY_TARGET_LIBRARIES}
)

IF(MINGW)
LIST(APPEND my_libs ssp) # add stack smash protection lib
ENDIF(MINGW)

TARGET_LINK_LIBRARIES(${lib_name} ${my_libs})

# Update CTK_BASE_LIBRARIES
Expand Down
5 changes: 5 additions & 0 deletions CMake/ctkMacroBuildPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ MACRO(ctkMacroBuildPlugin)
SET(my_libs
${MY_TARGET_LIBRARIES}
)

IF(MINGW)
LIST(APPEND my_libs ssp) # add stack smash protection lib
ENDIF()

TARGET_LINK_LIBRARIES(${lib_name} ${my_libs})

# Install headers
Expand Down

0 comments on commit e87fe15

Please sign in to comment.