diff options
author | Seeker <meaningseeking@protonmail.com> | 2020-07-30 17:41:19 -0700 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2020-08-03 09:03:04 -0400 |
commit | 0afcf59b7c9549736ffb1aac47df033abe847c6e (patch) | |
tree | 0328bfa26052a61871b1230aa7bf055fce7c22a1 /cmake/Modules | |
parent | a4b7a48f71a059c7410ee3e97aa682361cf22799 (diff) |
cmake: Add `-undefined dynamic_lookup` linker flag back for macOS
For Homebrew, gnuradio is built against brewed Python 3.8. This means
that GR will link against that Python.
If later on the user has another Python 3 in their path, running `gnuradio`
will fail with the `Abort Trap 6` error message.
On Linux, you do not need this flag, as this is the default behaviour of
the compiler. On Mac, you need to explicitly ask for dynamic lookup.
This setting was removed in commit ab2fb35677e38a384df3f9503d1f45f64bbc0374
and this patch adds it back in.
Diffstat (limited to 'cmake/Modules')
-rw-r--r-- | cmake/Modules/GrPython.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake index a872618b07..ff7927c05a 100644 --- a/cmake/Modules/GrPython.cmake +++ b/cmake/Modules/GrPython.cmake @@ -37,9 +37,14 @@ set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests") add_library(Python::Python INTERFACE IMPORTED) +if(APPLE) + set_target_properties(Python::Python PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${PYTHON_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "-undefined dynamic_lookup" + ) # Need to handle special cases where both debug and release # libraries are available (in form of debug;A;optimized;B) in PYTHON_LIBRARIES -if(PYTHON_LIBRARY_DEBUG AND PYTHON_LIBRARY_RELEASE) +elseif(PYTHON_LIBRARY_DEBUG AND PYTHON_LIBRARY_RELEASE) set_target_properties(Python::Python PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PYTHON_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:Debug>>:${PYTHON_LIBRARY_RELEASE}>;$<$<CONFIG:Debug>:${PYTHON_LIBRARY_DEBUG}>" |