-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Do not link against specific Python version on OS X
Added new CMake macro sitk_target_link_libraries_with_dynamic_lookup, to help resolve symbols at load time and not link time. This macro is used to link loadable module against their language libraries to improve compatibility. This will help packaging on homebrew, as homebrew is starting to enforce the policy that libraries should not be linked to a specific python. Thanks to: Michka Popoff <michkapopoff@gmail.com> Change-Id: Idc02ecb7a567a0e8c022097ff827f51a6af2e80d
- Loading branch information
Showing
8 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
# | ||
# Link a library to a target such that the symbols are resolved at | ||
# run-time not link-time. This should be used when compiling a | ||
# loadable module when the symbols should be resolve from the run-time | ||
# environment where the module is loaded, and not a specific system | ||
# library. | ||
# | ||
# Specifically, for OSX it uses undefined dynamic_lookup. This is | ||
# simular to using "-shared" on Linux where undefined symbols are | ||
# ignored. | ||
# | ||
# http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/ | ||
# | ||
macro( sitk_target_link_libraries_with_dynamic_lookup target ) | ||
if ( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" ) | ||
set_target_properties( ${target} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) | ||
else() | ||
target_link_libraries ( ${target} ${ARGN} ) | ||
endif() | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters